Llama 2_Huggingface_4Bit_QLoRA
1.0.0
更新されたバージョンは新しいリポジトリにあります
https://github.com/gmongaras/wizard_qlora_finetuning
ハギングフェイスを使用した4ビットQlora Falcon/llama2モデルの実用的な例
Finetuningを開始するには、 main.pyを編集して実行します
Finetuningが完了したら、 ./outputsにチェックポイントが必要です。推論を実行する前に、LORAウェイトと元の重みを組み合わせて、推論中により速い推論とより小さなGPU要件を組み合わせることができます。これを行うには、パスでmerge_weights.pyスクリプトを実行します。
最後に、マージされたモデルを考慮して、 generate.pyを実行することができます。
スクリプトを実行するためのPython要件はcompoiss.txtにあります
また、7Bモデルのファルコンウェイトをこちらのhttps://huggingface.co/tiiuae/falcon-7bをダウンロードし、ファイルを./tiiuae/falcon-7bに配置するか、llama-2 weightsをここにダウンロードするか、 https://huggingface.co/meta-llama/Llama-2-7b-hfとallma-2-7bhf-rma-rama-llama-2-7b ./llama-2 2をダウンロードする必要があります。
このスクリプトは、4ビットのFinetuningでマルチ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 。そうすれば、ソースからビットアンドバイトを構築し、https: https://github.com/oobabooga/text-generation-webui/issues/147