Comments (5)
@huangqingyi-code
1、效果的比对直接看原始论文吧,那个更客观一些
2、可能要试下,先加载的base model,再用peft加载adapter model:
……
base_model = AutoModel.from_pretrained(config.base_model_name_or_path,
quantization_config=q_config,
trust_remote_code=True,
device_map='auto')
model1 = PeftModel.from_pretrained(base_model, peft_model_path1)
model2 = PeftModel.from_pretrained(base_model, peft_model_path2)
from chatglm-6b-qlora.
1.qlora原始论文一顿吹比lora好,实际很多人反馈不是这样
2.这样内存中就有model1,model2两个model比较占资源,如果lora比较多10来个就会有问题了。我的想法是不先合并加载好模型,推理计算用到哪个lora再进行简单的weight相加。
from chatglm-6b-qlora.
@huangqingyi-code
1、个人观点,还是针对具体问题吧,没有最好的方法,只有针对某个数据集最好的方法。直观来说,从fp32->fp16->int8->int4确实是有损失的,甚至全参数调参->lora等一众高效微调,直观上看,也是有损失的,所以这个效果得看具体问题和资源的匹配了。
2、你说的应该是这种:https://huggingface.co/docs/peft/package_reference/peft_model#peft.PeftModel.set_adapter
from chatglm-6b-qlora.
是的,谢谢
from chatglm-6b-qlora.
model1 = PeftModel.from_pretrained(base_model, peft_model_path1)
model1 = PeftModel.from_pretrained(base_model, peft_model_path1)
这行代码运行之后 base_model 参数也会更改的 ,也会变成 peft model1 的参数 ,可以打印model 各个layer 对比,这个问题之前还坑了我几次。
from chatglm-6b-qlora.
Related Issues (20)
- 数据集格式instruction,input,output时tokenized出错 HOT 2
- 训练结束后,数据展示出现问题
- merge后模型Loading checkpoint shards Killed HOT 6
- 调优后的模型是否可以在CPU服务上部署? HOT 1
- protobuf 和 icetk 版本不兼容 HOT 1
- ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory HOT 12
- RuntimeError: mat1 and mat2 shapes cannot be multiplied (588x4096 and 1x9437184) ,ChatGLM2-6B做微调,请问如何设置参数?? HOT 1
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument target in method wrapper_CUDA_nll_loss_forward),请问如何调整训练代码,适配多卡训练?? HOT 1
- transformers>4.30.2时,模型不会进行量化,是因为什么?
- BrokenPipeError: [Errno 32] Broken pipe HOT 7
- 训练结束后没有保存完整的adapter文件 HOT 2
- 用V100显卡微调chatglm2-6b,但是loss一直为0,eval_loss=nan
- 训练显存有些问题
- 微调后推理性能问题 HOT 1
- ChatGLM3-6B 微调报错 RuntimeError: CUDA error: invalid argument HOT 1
- ChatGLM2-6B微调后合并报错We need an `offload_dir` to dispatch this model according to this `device_map`, the following submodules need to be offloaded: HOT 2
- 合并模型的时候显存不够,用的4090,24G
- qlora微调训练随机性
- ValueError:
- ChatGLM2-6b模型合并时报错ValueError: We need an `offload_dir` to dispatch this model according to this `device_map`, the following submodules need to be offloaded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatglm-6b-qlora.