linyiLYi / bilibot

A local chatbot fine-tuned by bilibili user comments.
Apache License 2.0
2.93k stars 342 forks source link

林哥,我想问一下M1 16G 能跑吗? #1

Open kh-Zhu-NJU opened 1 month ago

kh-Zhu-NJU commented 1 month ago

林哥,我想问一下M1 16G 的MacBook Air,想用您的这套代码Finetune一个模型,把batchsize和layer都调很低,大概得训练多久呢?还是说直接跑不动呢?实在没钱换M3了。那要是租云服务器的Nvida的卡,您这套基于mac的代码还能跑通吗?

lee1221ee commented 1 month ago

试过了 0.5B 是可以跑起来,但效果太惨了

对于非 32B 的模型,--lora-layers 需要改吗?

# 微调
python -m mlx_lm.lora --model models/Qwen1.5-0.5B-Chat --data data/ --adapter-path models/Qwen1.5-0.5B-Chat-Adapters --train --iters 1000 --batch-size 1 --lora-layers 12

# 合并
python -m mlx_lm.fuse --model models/Qwen1.5-0.5B-Chat --save-path models/Qwen1.5-0.5B-Chat-FT --adapter-path models/Qwen1.5-0.5B-Chat-Adapters

# 压缩
python compress_model.py
image
hh-wu commented 1 month ago

同问,我是m1 max 64g

nigo81 commented 1 month ago

qwen:32b-chat 模型就是18G

Redevil10 commented 1 month ago

试了一下,16G内存的Mac,可以跑起来Qwen1.5-4B-Chat。

Screenshot 2024-05-13 at 12 18 51 PM
lancelvlu commented 1 month ago
image

0.5b刚训练完,效果不咋地。macmini 丐版 m2pro 16gb内存

hh-wu commented 3 weeks ago

同问,我是m1 max 64g

截屏2024-06-03 15 08 55 (2)

调整中,速度挺慢的