Edit model card

Gemmaベースの日英、英日ニューラル機械翻訳モデルであるwebbigdata/C3TR-AdapterをGPUがないPCでも動かせるようにggufフォーマットに変換したモデルです。
A Japanese-English and English-Japanese neural machine translation model, webbigdata/C3TR-Adapter, converted to gguf format so that it can run on a PC without a GPU.

簡単に試す方法(Easy way to try it)

Googleの無料WebサービスColabを使うとブラウザを使って試す事ができます。
You can try it using your browser with Colab, Google's free web service.

リンク先で[Open in Colab]ボタンを押してColabを起動してください
Press the [Open in Colab] button on the link to start Colab
Colab Sample C3TR_Adapter_gguf_Free_Colab_sample

利用可能なVersion(Available Versions)

llama.cppを使うと、様々な量子化手法でファイルのサイズを小さくする事が出来ますが、本サンプルでは6種類のみを扱います。小さいサイズのモデルは、少ないメモリで高速に動作させることができますが、モデルの性能も低下します。4ビット(q4_0)くらいがバランスが良いと言われています。
Although llama.cpp can be used to reduce the size of the file with various quantization methods, this sample deals with only six types. Smaller models can run faster with less memory, but also reduce the performance of the models. 4 bits (q4_0) is said to be a good balance.

  • C3TR-Adapter.Q4_0.gguf 5.01 GB
  • C3TR-Adapter.Q4_1.gguf 5.5 GB
  • C3TR-Adapter.Q5_0.gguf 5.98 GB
  • C3TR-Adapter.Q5_1.gguf 6.47 GB
  • C3TR-Adapter.IQ3_M.gguf 3.9 GB (3.66 bpw quantization mix. 動作確認できた最も小さいモデル。The smallest model that has been confirmed to work)
  • C3TR-Adapter.IQ1_S.gguf 2.16 GB (1.56 bpw quantization. まだ正常動作しないが原理上最も小さいモデル。Smallest model in principle, although it still does not work properly)

サンプルコード(sample code)

ColabのCPUは少し遅いので、少し技術的な挑戦が必要ですが皆さんが所有しているPCで動かす方が良いでしょう。
Colab's CPU is a bit slow, so it would be better to run it on your own PC, which requires a bit of a technical challenge.

Install and compile example(linux)

その他のOSについてはllama.cpp公式サイトを確認してください
For other operating systems, please check the llama.cpp official website

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make

推論実行例(Inference execution sample)

英日翻訳(Translate English to Japanese)

./main -m ./C3TR-Adapter.Q4_1.gguf -e --temp 0 --repeat-penalty 1.0 -n -2  -p "### Instructions:
Translate English to Japanese.
### Input:
'The Boy and the Heron' follows a boy named Mahito Maki who moves to the countryside after his mother's death. There, he is lured by a mysterious heron into a secluded tower, a portal that transports him to a fantastical realm amid his grief.
### Answer:
"

出力例(output)

### Instructions:
Translate English to Japanese.
### Input:
'The Boy and the Heron' follows a boy named Mahito Maki who moves to the countryside after his mother's death. There, he is lured by a mysterious heron into a secluded tower, a portal that transports him to a fantastical realm amid his grief.
### Answer:
「少年と鷺」は、母親の死後、田舎に引っ越したマキマヒト少年の物語を描く。彼は謎の鷺に誘われ、悲しみに包まれたまま、隠された塔に連れていかれ、幻想的な世界へと導かれる。
 [end of text]

日英翻訳時(Translate Japanese to English)

./main -m ../upload/C3TR-Adapter.Q4_1.gguf -e --temp 0 --repeat-penalty 1.0 -n -2  -p "### Instructions:
Translate Japanese to English.
### Input:
「でも『オスカー取りたい』と思ってこの仕事をやってきたのではなく、いかに中学生の頃の気持ちを忘れずに、あの時作りたかったものにどれだけ近づけるかということをずっとやり続けてきたので、『未知との遭遇』と『スター・ウォーズ』を見てメロメロになった中 学生の自分に、今は感謝しています。
### Answer:
"

出力例(output)

### Instructions:
Translate Japanese to English.
### Input:
「でも『オスカー取りたい』と思ってこの仕事をやってきたのではなく、いかに中学生の頃の気持ちを忘れずに、あの時作りたかったものにどれだけ近づけるかということをずっとやり続けてきたので、『未知との遭遇』と『スター・ウォーズ』を見てメロメロになった中学生の自分に、今は感謝しています。
### Answer:
"But I didn't come to this job to win an Oscar. I've always tried to stay in touch with my teenage self, to see how close I could get to what I wanted to make back then. I'm grateful to my teenage self now, who was so in love with "Close Encounters" and "Star Wars."
 [end of text]

パラメーター(Parameters)

現在のgguf版は翻訳後に幻覚を追加出力してしまう傾向があり、パラメーターを適宜調整する必要があります。
The current gguf version tends to add hallucinations after translation and the parameters need to be adjusted accordingly.

必要に応じて下記のパラメーターを調整してください

  • 温度(--temp): この値を下げると、モデルがより確信度の高い(つまり、より一般的な)単語を選択する傾向が強くなります。
  • トップP(--top_p): この値をさらに低く設定することで、モデルが考慮する単語の範囲を狭め、より一貫性のあるテキストを生成するようになります。
  • 生成する単語数(-n): この値を減らすことで、モデルが生成するテキストの長さを短くし、不要な追加テキストの生成を防ぐことができます。-1 = 無限大、-2 = 文脈が満たされるまで。

以下はllama.cppの作者(ggerganov)による推奨パラメーターです

  • -e (改行\nをエスケープ)
  • --temp 0 (最も確率の高いトークンのみを選択)
  • --repeat-penalty 1.0 (繰り返しペナルティをオフ。指示調整済モデルでこれをするのは、決して良い考えとは言えないとの事。)
  • --no-penalize-nl (改行の繰り返しにはペナルティをあたえない) 最新のllama.cppではディフォルト動作になったので指定不要

Adjust the following parameters as needed

  • Temperature (--temp): Lowering this value will make the model more likely to select more confident (i.e., more common) words.
  • Top P (--top_p): Setting this value even lower will narrow the range of words considered by the model and produce more consistent text.
  • Number of words to generate (-n): Reducing this value will shorten the length of text generated by the model and prevent the generation of unnecessary additional text. -1 = infinity(default), -2 = until context filled.

The following are the recommended parameters by the author of llama.cpp(ggerganov)

  • -e (escape newlines (\n))
  • --temp 0(pick most probable tokens)
  • --repeat-penalty 1.0(disable repetition penalty (it's never a good idea to have this with instruction tuned models)~~ latest llama.cpp default behavior, so don't mind.
  • --no-penalize-nl(do not penalize repeating newlines) latest llama.cpp's default behavior so you need not this option.
Downloads last month
328
GGUF
+1
Inference Examples
Unable to determine this model's library. Check the docs .