0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LLaMA-Factoryでgoogle/gemma-2-2b-jpn-itのファインチューニングをサポートする方法

Posted at

はじめに

LLaMA-Factoryは、さまざまな言語モデルを簡単にファインチューニングできる便利なツールです。今回は、LLaMA-Factoryでgoogle/gemma-2-2b-jpn-itモデルのファインチューニングをサポートするための手順を紹介します。

手順

1. constants.pyの編集

まず、constants.pyファイルを編集して、google/gemma-2-2b-jpn-itモデルを追加します。

vi ./src/llamafactory/extras/constants.py

以下のように、Gemma-2-2B-JPN-Instructのエントリを追加します。

        "Gemma-2-2B-Instruct": {
            DownloadSource.DEFAULT: "google/gemma-2-2b-it",
            DownloadSource.MODELSCOPE: "LLM-Research/gemma-2-2b-it",
            DownloadSource.OPENMIND: "LlamaFactory/gemma-2-2b-it",
        },
        "Gemma-2-2B-JPN-Instruct": {
            DownloadSource.DEFAULT: "google/gemma-2-2b-jpn-it",
        },
        "Gemma-2-9B-Instruct": {
            DownloadSource.DEFAULT: "google/gemma-2-9b-it",
            DownloadSource.MODELSCOPE: "LLM-Research/gemma-2-9b-it",
            DownloadSource.OPENMIND: "LlamaFactory/gemma-2-9b-it",
        },

2. 変更の適用

編集が終わったら、ファイルを保存して変更を適用します。

まとめ

これで、LLaMA-Factoryでgoogle/gemma-2-2b-jpn-itモデルのファインチューニングが可能になりました。この変更により、日本語の指示に特化したモデルのファインチューニングがより簡単に行えるようになります。

参考

この記事が役に立ったら、ぜひいいねやシェアをお願いします!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?