LoginSignup
8
8

Llama.cppで扱えるモデル形式が GGMLからGGUFに変更になりモデル形式の変換が必要になった話

Posted at

はじめに

Llama2は Meta がリリースした大規模言語モデル(LLM)だ。Llama2をWindows/Linux/MacのようなOSがインストールされた、いわゆるパソコン(PC)で動作させるランタイムとしてllama.cppが公開されている。

これまでの利用方法

llama.cpp を利用するためには Llama2 がGGML形式に変換されている必要がある

これまでの例
./main -m ./models/llama-2-7b-chat.ggmlv3.q4_K_M.bin --temp 0.1 -p "### Instruction: What is LLM? ### Response:"

今後の利用方法

llama.cpp がGGMLのサポートを終了し GGUF 形式への変換が必要になる
GGUF形式へのコンバーターはllama.cpp のリポジトリで公開されている。
下記のように自前でコンバートすることが可能だ。

python convert-llama-ggmlv3-to-gguf.py --input llama-2-7b-chat.ggmlv3.q4_K_M.bin --output llama-2-7b-chat.q4_K_M.gguf
これからの例
./main -m ./models/llama-2-7b-chat.q4_K_M.gguf --temp 0.1 -p "### Instruction: What is LLM? ### Response:"

Llama2 の使用例の記事の一部

8
8
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
8
8