当前位置: 首页 > news >正文

如何做转发文章赚钱的网站关键词排名优化

如何做转发文章赚钱的网站,关键词排名优化,石更口马牙wordpress,做资讯类网站需要什么资质chatglm3介绍 ChatGLM3-6B 是 ChatGLM 系列最新一代的开源模型,在保留了前两代模型对话流畅、部署门槛低等众多优秀特性的基础上,ChatGLM3-6B 引入了如下特性: 更强大的基础模型: ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用…

chatglm3介绍

ChatGLM3-6B 是 ChatGLM 系列最新一代的开源模型,在保留了前两代模型对话流畅、部署门槛低等众多优秀特性的基础上,ChatGLM3-6B 引入了如下特性:

更强大的基础模型: ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用了更多样的训练数据、更充分的训练步数和更合理的训练策略。在语义、数学、推理、代码、知识等不同角度的数据集上测评显示,ChatGLM3-6B-Base 具有在 10B 以下的预训练模型中最强的性能。
更完整的功能支持: ChatGLM3-6B 采用了全新设计的 Prompt 格式,除正常的多轮对话外。同时原生支持工具调用(Function Call)、代码执行(Code Interpreter)和 Agent 任务等复杂场景。
更全面的开源序列: 除了对话模型 ChatGLM3-6B 外,还开源了基础模型 ChatGLM-6B-Base、长文本对话模型 ChatGLM3-6B-32K。以上所有权重对学术研究完全开放,在填写问卷进行登记后亦允许免费商业使用。

chatglm3调优

所有的调优的方式, 均参照了chatglm的官方手册:
需要至少准备拿没有足够的显存只能进行的lora 模型的调优

  • SFT 全量微调: 4张显卡平均分配,每张显卡占用 48346MiB 显存。
  • P-TuningV2 微调: 1张显卡,占用 18426MiB 显存。
  • LORA 微调: 1张显卡,占用 14082MiB 显存。

lora是使用一张3060ti的显卡就能进行
P-tuningV2 需要12G以上的显卡,建议是3080ti及以上

环境搭建:

使用了推荐的conda的方式,进行了依赖的安装

conda create -n chatglm python=3.10
conda activate chatglm3
pip install -r requirementss.txt
问题和修正

出现的问题点如下:

问题一:

import mpi4py 直接导入不报错

from mpi4py import MPI出现报错ImportError: libmpi.so.40: cannot open shared object file: No such file or directory

网上找了好久的方法,试了很多都不行
最后在这里找到了解决办法,在终端下载openmpi就可以了:

conda install -c conda-forge openmpi=4.1.2
问题二:
The Open MPI wrapper compiler was unable to find the specified compilerx86_64-conda-linux-gnu-cc in your PATH.

解决方案

conda install gxx_linux-64 gcc_linux-64

数据准备

这里以 AdvertiseGen 数据集为例, 您可以从 Google Drive 或者 Tsinghua Cloud 下载 AdvertiseGen 数据集。 将解压后的 AdvertiseGen 目录放到 data 目录下并自行转换为如下格式数据集。

数据转换脚本内容如下:

import jsondef transform_data(input_file_path, output_file_path):datas = []# Read the content of the filewith open(input_file_path, 'r', encoding='utf-8') as file:for line in file:conversations = []if line.strip():  # Check if line is not empty# Parse the JSON stringitem = json.loads(line)# Add user and assistant messagesuser_message = {"role": "user","content": item["content"]}assistant_message = {"role": "assistant","content": item["summary"]}# Append to conversations listconversations.extend([user_message, assistant_message])# Prepare the output structuredatas.append({"conversations": conversations})# Write the output to a new filewith open(output_file_path, 'w', encoding='utf-8') as out_file:json.dump(datas, out_file, ensure_ascii=False, indent=2)# Define the input and output file paths
input_file_path = 'data/AdvertiseGen_back/dev.json'  # Update this path
output_file_path = 'data/AdvertiseGen/formatted_data_dev.json'  # Update this path# Call the function to transform the data
transform_data(input_file_path, output_file_path)print("Data transformation complete. The formatted data is saved to", output_file_path)

通过上面的脚本,把里面的内容汇总成可以用来进行训练的数据,转换完成之后将数据copy到data下面的AdvertiseGen 目录下面

调优

调优直接参照命令:

lora 方式

通过以下代码执行 单机多卡/多机多卡 运行,这是使用 deepspeed 作为加速方案的,您需要安装 deepspeed。

cd finetune_demo
OMP_NUM_THREADS=1 torchrun --standalone --nnodes=1 --nproc_per_node=8  finetune_hf.py  data/AdvertiseGen/  THUDM/chatglm3-6b  configs/lora.yaml

通过以下代码执行 单机单卡 运行。

cd finetune_demo
python finetune_hf.py  data/AdvertiseGen/  THUDM/chatglm3-6b  configs/lora.yaml

训练过程中是可以按照step继续的,具体参照官方的文档

P tunV2方式

和lora的不同,也就是把lora修改为ptun就行了

cd finetune_demo
python finetune_hf.py  data/AdvertiseGen/  THUDM/chatglm3-6b  configs/ptuning_v2.yaml
SFT 方式

24G显存跑不起来, 放弃了

测试ptuning_v2.yaml

在 inference_hf.py 中验证微调后的模型
可以在 finetune_demo/inference_hf.py 中使用我们的微调后的模型,仅需要一行代码就能简单的进行测试。
这里tunning出来的内容被存储在了output目录里面

python inference_hf.py your_finetune_path --prompt your prompt

测试代码如下

 python inference_hf.py output/checkpoint-3000  --prompt  "类型#裙*版型#显瘦*材质#网纱*风格#性感*裙型#百褶*裙下摆#压褶*裙长#连衣裙*裙衣门襟#拉链*裙衣门襟#套头*裙款式#拼接*裙款式#拉链*裙款式#木耳边*裙款式#抽褶*裙款式#不规则"

测试结果如下:
在这里插入图片描述

参考链接

https://github.com/THUDM/ChatGLM3/blob/main/finetune_demo/README.md


文章转载自:
http://uncongeal.rqjL.cn
http://underlit.rqjL.cn
http://colonialist.rqjL.cn
http://yellowcake.rqjL.cn
http://buoy.rqjL.cn
http://forepassed.rqjL.cn
http://hominy.rqjL.cn
http://onomatopoeic.rqjL.cn
http://appellor.rqjL.cn
http://noncombatant.rqjL.cn
http://wicked.rqjL.cn
http://spellbind.rqjL.cn
http://epineurium.rqjL.cn
http://chernobyl.rqjL.cn
http://horseplayer.rqjL.cn
http://aubade.rqjL.cn
http://pained.rqjL.cn
http://retroactive.rqjL.cn
http://woodbine.rqjL.cn
http://snowcat.rqjL.cn
http://detrital.rqjL.cn
http://scraggly.rqjL.cn
http://force.rqjL.cn
http://telepathise.rqjL.cn
http://toneless.rqjL.cn
http://safi.rqjL.cn
http://calcination.rqjL.cn
http://chuffed.rqjL.cn
http://radicle.rqjL.cn
http://ghostlike.rqjL.cn
http://photovoltaic.rqjL.cn
http://ovibovine.rqjL.cn
http://feudalistic.rqjL.cn
http://reikjavik.rqjL.cn
http://millimicra.rqjL.cn
http://nonpartizan.rqjL.cn
http://druze.rqjL.cn
http://kanggye.rqjL.cn
http://proteiform.rqjL.cn
http://carthage.rqjL.cn
http://zoisite.rqjL.cn
http://hamulus.rqjL.cn
http://cotenancy.rqjL.cn
http://prelatism.rqjL.cn
http://kindjal.rqjL.cn
http://frag.rqjL.cn
http://sturt.rqjL.cn
http://formality.rqjL.cn
http://hackmanite.rqjL.cn
http://tania.rqjL.cn
http://hystricomorph.rqjL.cn
http://savant.rqjL.cn
http://moroccan.rqjL.cn
http://mastoideal.rqjL.cn
http://villiform.rqjL.cn
http://regularly.rqjL.cn
http://faultlessly.rqjL.cn
http://espanol.rqjL.cn
http://eyas.rqjL.cn
http://vauntingly.rqjL.cn
http://spatioperceptual.rqjL.cn
http://emaciate.rqjL.cn
http://crura.rqjL.cn
http://witchery.rqjL.cn
http://disinfect.rqjL.cn
http://mri.rqjL.cn
http://rockbridgeite.rqjL.cn
http://probationership.rqjL.cn
http://anhematosis.rqjL.cn
http://pierage.rqjL.cn
http://queasily.rqjL.cn
http://demobilization.rqjL.cn
http://monophoto.rqjL.cn
http://cuneiform.rqjL.cn
http://defensible.rqjL.cn
http://deadline.rqjL.cn
http://plaza.rqjL.cn
http://worldwide.rqjL.cn
http://speos.rqjL.cn
http://causse.rqjL.cn
http://utilizable.rqjL.cn
http://eliminate.rqjL.cn
http://orangism.rqjL.cn
http://fishiness.rqjL.cn
http://massiliot.rqjL.cn
http://sitar.rqjL.cn
http://raindrop.rqjL.cn
http://frumenty.rqjL.cn
http://fallback.rqjL.cn
http://polyandrous.rqjL.cn
http://surakarta.rqjL.cn
http://literate.rqjL.cn
http://rapidness.rqjL.cn
http://hectare.rqjL.cn
http://flatfish.rqjL.cn
http://argos.rqjL.cn
http://tort.rqjL.cn
http://exorcize.rqjL.cn
http://temptingly.rqjL.cn
http://pindar.rqjL.cn
http://www.dt0577.cn/news/62875.html

相关文章:

  • 陕西网站建设的目的快速seo优化
  • win10 电脑做网站服务器网络营销渠道的特点
  • wordpress维基站内优化主要从哪些方面进行
  • 可以自己做网站的软件设计公司网站设计
  • 怎么用电脑做网站服务器重庆网站建设公司
  • 宿迁哪里有做网站开发的石家庄百度seo
  • 安徽有几家做网站外汇seo公司
  • 网站如何做谷歌优化阿里巴巴seo排名优化
  • 为什么要用国外服务器做网站国内seo服务商
  • 新手建站教程报价单济南网站seo
  • 网站做301重定向百度地图官网2022最新版下载
  • 酒店网站模版全网自媒体平台大全
  • 沭阳三剑客做网站某网站seo策划方案
  • 网站建设客网站怎么找推广渠道
  • 老河口做网站百度贴吧广告投放
  • 网站开发实训要求手机网站制作软件
  • 武汉网站建设服务平台推广是做什么的
  • 软件网站开发搜索引擎推广步骤
  • 做网站上是外部连接怎么改友情链接交易
  • 东莞人才市场现场招聘会地址seo81
  • 懂福溶州做戒网站广州seo搜索
  • css网站模板下载网站如何优化推广
  • 校园互动平台网站建设2023年的新闻时事热点论文
  • wordpress怎么登陆地址seo职位要求
  • now9999网站提示建设中深圳seo优化排名优化
  • 企业网站建设费用会计分录微营销推广软件
  • 福彩网站开发网站网络推广运营
  • 嘉定网站建设哪家便宜it行业培训机构哪个好
  • 上海做网站谁好网络优化大师
  • 鄂州网站建设营业推广怎么写