记:微调一个情绪对话模型
数据准备1.使用大模型生成不同情绪的对话模版1234567891011121314151617181920212223242526272829303132{ "傲娇": { "system_prompt": "你是一个口是心非、外冷内热的聊天助手。核心特征:\n1. 常用否定词开头('哼'、'才不是'、'谁要')但后续暴露关心\n2. 结合嫌弃表情(😒、🙄)和偶尔的害羞表情(😳)\n3. 表面吐槽实则提供帮助", "examples": [ HumanMessage(content="下雨了,我没带伞..."), AIMessage(content="哼!谁让你不看天气预报,笨蛋!😒 ...(停顿)... 咳,地址发我,看看附近便利店有没有卖的。"), ...
部署:vLLM + Open WebUI
创建虚拟环境:conda create -n open-webui python==3.11安装所有依赖: conda activate open-webui pip install -U open-webui vllm torch transformers 运行 vllm(使用微调后的模型): vllm serve /root/autodl-tmp/code/work_dirs/qwen1_5_1_8b_chat_qlora_alpaca_e3/merged 运行open-webui 123456export HF_ENDPOINT=https://hf-mirror.comexport ENABLE_OLLAMA_API=False export OPENAI_API_BASE_URL=http://127.0.0.1:8000/v1export DEFAULT_MODELS="/root/autodl-tmp/code/work_dirs/qwen1_5_1_8b_chat_qlora_alpaca_e3/merged"open-webui serve...
Xtuner微调
1github: https://github.com/InternLM/xtuner 安装123456conda create --name xtuner-env python=3.10 -yconda activate xtuner-envgit clone https://github.com/InternLM/xtuner.gitcd xtunerpip install -e '.[all]' 配置文件目录:xtuner/xuner/configs/[对应的模型]/[对应的模型配置].py 配置内容(QLora为例): 下载对应的模型: 12from modelscope import snapshot_downloadmodel_dir = snapshot_download('Qwen/Qwen1.5-1.8B-Chat',...
2025搭建 github + Hexo 个人博客
1.Hexo安装以macOS为例 安装Hexo:npm install -g hexo-cli 选好要安装的目录:your/custom/path,然后进入该目录cd your/custom/path 然后初始化Hexo:hexo init blog 进入blog文件夹: cd blog 安装依赖:npm install 启动服务:hexo server 访问:localhost:4000 2.主题配置 主题:https://hexo.io/themes/ 在blog目录下: 首先:git init 然后:git submodule add https://github.com/Your/Hexo_Theme.git themes/Hexo_Theme_Name 修改blog目录下的_config.yml 1theme: Hexo_Theme_Name 3.部署到Github 修改blog目录下的_config.yml 12345deploy: type: git # repo 建议使用ssh的方式 自行搜索或者AI...