Llama 2_Huggingface_4Bit_QLoRA
1.0.0
更新版本可以在新的回購中找到
https://github.com/gmongaras/wizard_qlora_finetuning
使用HuggingFace的4位Qlora Falcon/Llama2型號的工作示例
要開始登錄,編輯和運行main.py
填充完成後,您應該在./outputs中具有檢查點。在運行推理之前,我們可以將洛拉的權重與原始權重結合,以更快地推斷和推理期間的GPU要求較小。為此,請使用您的路徑運行merge_weights.py腳本。
最後,您可以在合併的模型給定模型下運行生成generate.py 。
運行腳本的Python要求位於sumpliont.txt中
您還應該在此處下載7b型號的獵鷹權重https://huggingface.co/tiiuae/falcon-7b ,然後將文件放入目錄中./tiiuae/falcon-7b或https://huggingface.co/meta-llama/Llama-2-7b-hf此處下載llama-2權重./llama-2
該腳本不支持4位登錄上的多GPU。如果我找到了這樣做的方法,我將更新腳本。
python -m pip uninstall bitsandbytes transformers accelerate peft -y
python -m pip install git+https://github.com/huggingface/transformers.git git+https://github.com/huggingface/peft.git git+https://github.com/huggingface/accelerate.git git+https://github.com/timdettmers/bitsandbytes.git -U
CUDA Setup failed despite GPU being available. Please run the following command to get more information ,然後您需要從源來構建bitsandbytes,然後按照https://github.com/oobabooga/text-generation-webui/issues/147 ,將其放入零件和字節site-package中。