大規模言語モデルの学習コードをまとめました。 1. Alpacaの学習コード「LLaMA 」を標準の「HuggingFace Transformers」の学習コードをでファインチューニングを行います。 「Transformers」はまだ「LLaMA」を公式サポートしてないため、特定のフォーク(68d640f7c368bcaaaecfc678f11908ebbd3d6176)を使用します。 以下は、FSDP full_shard モードで 4つの A100 80G GPU を搭載したマシン上のデータセットで「LLaMA-7B」をファインチューニングするコマンドです。 torchrun --nproc_per_node=4 --master_port=<your_random_port> train.py \ --model_name_or_path <your_path_to_hf_conv
![大規模言語モデルの学習コードまとめ|npaka](https://cdn-ak-scissors.b.st-hatena.com/image/square/58e6610423a56240bea4c0d568d9bf4793f1c98e/height=288;version=1;width=512/https%3A%2F%2Fassets.st-note.com%2Fproduction%2Fuploads%2Fimages%2F102155312%2Frectangle_large_type_2_1f83a61d9bbd7164e31c91b67ea811ad.png%3Ffit%3Dbounds%26quality%3D85%26width%3D1280)