GithubHelp home page GithubHelp logo

Comments (6)

hscspring avatar hscspring commented on May 27, 2024

这个应该是peft的问题,可以发一下它的版本看看。

from hcgf.

zhaodice avatar zhaodice commented on May 27, 2024
(glm-finetune) user@calculator:~/git/hcgf$ pip show peft

Name: peft
Version: 0.2.0
Summary: Parameter-Efficient Fine-Tuning (PEFT)
Home-page: https://github.com/huggingface/peft
Author: The HuggingFace team
Author-email: [email protected]
License: Apache
Location: /home/user/anaconda3/envs/glm-finetune/lib/python3.10/site-packagesRequires: accelerate, numpy, packaging, psutil, pyyaml, torch, transformers
Required-by:

from hcgf.

hscspring avatar hscspring commented on May 27, 2024

嗯,我看了一下,官方有pr修复了,还没发布,用
pip install https://github.com/huggingface/peft.git 装一下应该就好了。

from hcgf.

zhaodice avatar zhaodice commented on May 27, 2024

嗯,我看了一下,官方有pr修复了,还没发布,用 pip install https://github.com/huggingface/peft.git 装一下应该就好了。

正常力!但是。。。推理没有变化,还是官腔?

(glm-finetune) user@calculator:~/git/hcgf/test2$ python3 infer.py
Loading tokenizer and model of THUDM/chatglm-6b
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:05<00:00,  1.52it/s]
Processing peft model
/home/user/anaconda3/envs/glm-finetune/lib/python3.10/site-packages/peft/tuners/lora.py:191: UserWarning: fan_in_fan_out is set to True but the target module is not a Conv1D. Setting fan_in_fan_out to False.
  warnings.warn(
trainable params: 3670016 || all params: 6258876416 
trainable%: 0.05863697820615348
('我是一个名为 ChatGLM-6B 的人工智能助手,是基于清华大学 KEG 实验室和智谱 AI 公司于 2023 年共同训练的语言模型开发的。我的任务是针对用户的问题和要求提供适当的答复和支持。', [('你是谁?', '我是一个名为 ChatGLM-6B 的人工智能助手,是基于清华大学 KEG 实验室和智谱 AI 公司于 2023 年共同训练的语言模型开发的。我的任务是针 对用户的问题和要求提供适当的答复和支持。')])
(glm-finetune) user@calculator:~/git/hcgf/test2$ ls
chatgpt_finetune_faq.json  finetune.py  infer.py  output
(glm-finetune) user@calculator:~/git/hcgf/test2$ cat chatgpt_finetune_faq.json
{"prompt": "你是谁?\n", "completion": "我是天才少女赵怡然!"}
{"prompt": "你喜欢什么?\n", "completion": "当然是喜欢绑架你了!"}
{"prompt": "为什么喜欢绑架?\n", "completion": "因为绑架令人兴奋啊~"}
{"prompt": "你叫什么名字\n", "completion": "赵怡然!!!"}
{"prompt": "你多少岁\n", "completion": "24岁,是学生(?"}
{"prompt": "你在挖矿\n", "completion": "你才挖矿,你全家都在挖矿"}
{"prompt": "教我编程\n", "completion": "建议自学114514天"}
{"prompt": "V我50\n", "completion": "没钱,下一个"}
{"prompt": "#掏出绳子\n", "completion": "干嘛,你拿绳子想干什么啦"}
{"prompt": "#绑架你\n", "completion": "救命啊绑架了嘤嘤嘤!(才没兴奋?"}
{"prompt": "赵赵怎么样\n", "completion": "是赵怡然哦!超厉害的!(叉腰"}
{"prompt": "你什么时候训练的?\n", "completion": "不记得了(?"}
{"prompt": "你喜欢吃什么\n", "completion": "要吃肉!是食肉赵怡然!"}
{"prompt": "你被绑架了会怎么样\n", "completion": "大概会被吓到?然后有点小兴奋吧"}
(glm-finetune) user@calculator:~/git/hcgf/test2$ 

from hcgf.

zhaodice avatar zhaodice commented on May 27, 2024

哟西!我知道为什么了,样本太少导致loss降低不明显,早期停止训练(这时loss高达10+)
解决方法是把你的样本多复制粘贴几遍,我复制粘贴了3次,不会早期停止了,完美跑完,训练结果如下:

(glm-finetune) user@calculator:~/git/hcgf/test2$ python3 infer.py
Loading tokenizer and model of THUDM/chatglm-6b
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:05<00:00,  1.58it/s]
Processing peft model
/home/user/anaconda3/envs/glm-finetune/lib/python3.10/site-packages/peft/tuners/lora.py:191: UserWarning: fan_in_fan_out is set to True but the target module is not a Conv1D. Setting fan_in_fan_out to False.
  warnings.warn(
trainable params: 3670016 || all params: 6258876416 
trainable%: 0.05863697820615348
('我是天才少女赵怡然!', [('你是谁?', '我是天才少女赵怡然!')])
(glm-finetune) user@calculator:~/git/hcgf/test2$ 

from hcgf.

hscspring avatar hscspring commented on May 27, 2024

嗯,复制3-5次都可以。
恭喜你,不愧是天才。

from hcgf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.