dahara1 commited on
Commit
6ba6631
·
verified ·
1 Parent(s): 4566171

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -29
README.md CHANGED
@@ -6,8 +6,25 @@ tags:
6
  - translation
7
  - gemma
8
  - llama.cpp
 
9
  ---
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  Gemmaベースの日英、英日ニューラル機械翻訳モデルである[webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter)をGPUがないPCでも動かせるようにggufフォーマットに変換したモデルです。
12
  A Japanese-English and English-Japanese neural machine translation model, [webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter), converted to gguf format so that it can run on a PC without a GPU.
13
 
@@ -17,20 +34,18 @@ You can try it using your browser with Colab, Google's free web service.
17
 
18
  リンク先で[Open in Colab]ボタンを押してColabを起動してください
19
  Press the [Open in Colab] button on the link to start Colab
20
- [Colab Sample C3TR_Adapter_gguf_Free_Colab_sample](https://github.com/webbigdata-jp/python_sample/blob/main/C3TR_Adapter_gguf_Free_Colab_sample.ipynb)
21
-
22
 
23
  ### 利用可能なVersion(Available Versions)
24
 
25
- llama.cppを使うと、様々な量子化手法でファイルのサイズを小さくする事が出来ますが、本サンプルでは6種類のみを扱います。小さいサイズのモデルは、少ないメモリで高速に動作させることができますが、モデルの性能も低下します。4ビット(q4_0)くらいがバランスが良いと言われています。
26
- 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.
27
 
28
- - C3TR-Adapter.Q4_0.gguf 5.01 GB
29
- - C3TR-Adapter.Q4_1.gguf 5.5 GB
30
- - C3TR-Adapter.Q5_0.gguf 5.98 GB
31
- - C3TR-Adapter.Q5_1.gguf 6.47 GB
32
- - C3TR-Adapter.IQ3_M.gguf 3.9 GB (3.66 bpw quantization mix. 動作確認できた最も小さいモデル。The smallest model that has been confirmed to work)
33
- - C3TR-Adapter.IQ1_S.gguf 2.16 GB (1.56 bpw quantization. まだ正常動作しないが原理上最も小さいモデル。Smallest model in principle, although it still does not work properly)
34
 
35
  ### サンプルコード(sample code)
36
 
@@ -50,46 +65,80 @@ make
50
 
51
  英日翻訳(Translate English to Japanese)
52
  ```
53
- ./main -m ./C3TR-Adapter.Q4_1.gguf -e --temp 0 --repeat-penalty 1.0 -n -2 -p "### Instructions:
 
 
54
  Translate English to Japanese.
 
 
 
 
 
55
  ### Input:
56
  '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.
57
- ### Answer:
58
- "
59
  ```
60
 
61
  出力例(output)
62
  ```
63
- ### Instructions:
64
- Translate English to Japanese.
65
  ### Input:
66
  '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.
67
- ### Answer:
68
- 「少年と鷺」は、母親の死後、田舎に引っ越したマキマヒト少年の物語を描く。彼は謎の鷺に誘われ、悲しみに包まれたまま、隠された塔に連れていかれ、幻想的な世界へと導かれる。
69
- [end of text]
70
  ```
71
 
72
 
73
  日英翻訳時(Translate Japanese to English)
74
  ```
75
- ./main -m ../upload/C3TR-Adapter.Q4_1.gguf -e --temp 0 --repeat-penalty 1.0 -n -2 -p "### Instructions:
76
- Translate Japanese to English.
 
 
 
 
 
 
 
 
77
  ### Input:
78
- 「でも『オスカー取りたい』と思ってこの仕事をやってきたのではなく、いかに中学生の頃の気持ちを忘れずに、あの時作りたかったものにどれだけ近づけるかということをずっとやり続けてきたので、『未知との遭遇』と『スター・ウォーズ』を見てメロメロになった中 学生の自分に、今は感謝しています。
79
- ### Answer:
 
 
 
 
80
  "
81
  ```
82
 
83
  出力例(output)
84
  ```
85
- ### Instructions:
86
- Translate Japanese to English.
 
 
 
 
 
 
87
  ### Input:
88
- 「でも『オスカー取りたい』と思ってこの仕事をやってきたのではなく、いかに中学生の頃の気持ちを忘れずに、あの時作りたかったものにどれだけ近づけるかということをずっとやり続けてきたので、『未知との遭遇』と『スター・ウォーズ』を見てメロメロになった中学生の自分に、今は感謝しています。
89
- ### Answer:
90
- "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."
91
- [end of text]
 
 
 
 
 
 
92
  ```
 
 
 
 
 
93
 
94
  ### パラメーター(Parameters)
95
 
@@ -118,4 +167,4 @@ The following are the [recommended parameters](https://huggingface.co/google/gem
118
  - --temp 0(pick most probable tokens)
119
  - --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.
120
  - ~~--no-penalize-nl(do not penalize repeating newlines)~~ latest llama.cpp's default behavior so you need not this option.
121
-
 
6
  - translation
7
  - gemma
8
  - llama.cpp
9
+ - gguf
10
  ---
11
 
12
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/630469550907b9a115c91e62/m11e35NrZMi7ZpBQ7C6KV.png)
13
+
14
+ # News
15
+ ## 2024.05.18
16
+
17
+ C3TR-Adapter_ggufのVersion2を公開しました。
18
+ Version 2 of C3TR-Adapter_gguf has been released.
19
+
20
+ Version2では主にカジュアルな会話に関する翻訳能力が大幅に向上しています。
21
+ Version 2 has greatly improved the ability to translate casual conversations.
22
+
23
+ その反面、フォーマルな文章の翻訳能力が少し落ちてしまっています。フォーマルな文章を対象にする場合、[Version1](https://huggingface.co/webbigdata/C3TR-Adapter_gguf/tree/version1)を引き続きお使いください
24
+ On the other hand, translation capabilities for formal texts have declined slightly. If you are targeting formal texts, please continue to use [Version1](https://huggingface.co/webbigdata/C3TR-Adapter_gguf/tree/version1).
25
+
26
+ # モデルカード(Model Card for Model ID)
27
+
28
  Gemmaベースの日英、英日ニューラル機械翻訳モデルである[webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter)をGPUがないPCでも動かせるようにggufフォーマットに変換したモデルです。
29
  A Japanese-English and English-Japanese neural machine translation model, [webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter), converted to gguf format so that it can run on a PC without a GPU.
30
 
 
34
 
35
  リンク先で[Open in Colab]ボタンを押してColabを起動してください
36
  Press the [Open in Colab] button on the link to start Colab
37
+ [Colab Sample C3TR_Adapter_gguf_v2_Free_Colab_sample](https://github.com/webbigdata-jp/python_sample/blob/main/C3TR_Adapter_gguf_v2_Free_Colab_sample.ipynb)
 
38
 
39
  ### 利用可能なVersion(Available Versions)
40
 
41
+ llama.cppを使うと、様々な量子化手法でファイルのサイズを小さくする事が出来ますが、本サンプルでは6種類のみを扱います。小さいサイズのモデルは、少ないメモリで高速に動作させることができますが、モデルの性能も低下します。4ビット(Q4_K_M)くらいがバランスが良いと言われています。
42
+ 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_K_M) is said to be a good balance.
43
 
44
+ - C3TR-Adapter.Q4_K_S.gguf 4.7 GB
45
+ - C3TR-Adapter.Q4_K_M.gguf 5.0 GB
46
+ - C3TR-Adapter.Q5_K_S.gguf 5.6 GB
47
+ - C3TR-Adapter.Q5_K_M.gguf 5.8 GB
48
+ - C3TR-Adapter.Q6_K.gguf 6.6 GB
 
49
 
50
  ### サンプルコード(sample code)
51
 
 
65
 
66
  英日翻訳(Translate English to Japanese)
67
  ```
68
+ ./main -m ../C3TR-Adapter.Q4_K_M.gguf -e --temp 0 --repeat-penalty 1.0 -n -2 -p "You are a highly skilled professional Japanese-English and English-Japanese translator. Translate the given text accurately, taking into account the context and specific instructions provided. Steps may include hints enclosed in square brackets [] with the key and value separated by a colon:. Only when the subject is specified in the Japanese sentence, the subject will be added when translating into English. If no additional instructions or context are provided, use your expertise to consider what the most appropriate context is and provide a natural translation that aligns with that context. When translating, strive to faithfully reflect the meaning and tone of the original text, pay attention to cultural nuances and differences in language usage, and ensure that the translation is grammatically correct and easy to read. After completing the translation, review it once more to check for errors or unnatural expressions. For technical terms and proper nouns, either leave them in the original language or use appropriate translations as necessary. Take a deep breath, calm down, and start translating.
69
+
70
+ ### Instruction:
71
  Translate English to Japanese.
72
+ When translating, please use the following hints:
73
+ [writing_style: journalistic]
74
+ [Heron: アオサギ]
75
+ [Mahito Maki: 牧眞人]
76
+
77
  ### Input:
78
  '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.
79
+
80
+ ### Response:
81
  ```
82
 
83
  出力例(output)
84
  ```
 
 
85
  ### Input:
86
  '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.
87
+
88
+ ### Response:
89
+ 『少年とアオサギ』は、母親が亡くなった後、田舎に引っ越してきた少年の牧眞人という名前の少年が、謎のアオサギに誘われて、孤独な塔に引き寄せられ、悲しみに紛れてファンタジーな世界に旅立つ物語です。<eos> [end of text]
90
  ```
91
 
92
 
93
  日英翻訳時(Translate Japanese to English)
94
  ```
95
+ ./main -m ../C3TR-Adapter.Q6_K.gguf -e --temp 0 --repeat-penalty 1.0 -n -2 -p "You are a highly skilled professional Japanese-English and English-Japanese translator. Translate the given text accurately, taking into account the context and specific instructions provided. Steps may include hints enclosed in square brackets [] with the key and value separated by a colon:. Only when the subject is specified in the Japanese sentence, the subject will be added when translating into English. If no additional instructions or context are provided, use your expertise to consider what the most appropriate context is and provide a natural translation that aligns with that context. When translating, strive to faithfully reflect the meaning and tone of the original text, pay attention to cultural nuances and differences in language usage, and ensure that the translation is grammatically correct and easy to read. After completing the translation, review it once more to check for errors or unnatural expressions. For technical terms and proper nouns, either leave them in the original language or use appropriate translations as necessary. Take a deep breath, calm down, and start translating.
96
+
97
+ ### Instruction:
98
+ Translate English to Japanese.
99
+ When translating, please use the following hints:
100
+ [writing_style: casual, game]
101
+ [hatsuharu: 初春]
102
+ [hatsuharu_first_person_and_ending: わらわ, なのじゃ]
103
+ [hatsuharu_character_style: のじゃロリ]
104
+
105
  ### Input:
106
+ hatsuharu 'Did you come to see me again, huh?'
107
+ hatsuharu 'Well, I suppose I can't help it. Don't worry, I'll protect this fleet.'
108
+ hatsuharu 'You can count on me. Hey, young one!'
109
+ hatsuharu 'Bring me more sweets, will you?'
110
+
111
+ ### Response:
112
  "
113
  ```
114
 
115
  出力例(output)
116
  ```
117
+ ### Instruction:
118
+ Translate English to Japanese.
119
+ When translating, please use the following hints:
120
+ [writing_style: casual, game]
121
+ [hatsuharu: 初春]
122
+ [hatsuharu_first_person_and_ending: わらわ, なのじゃ]
123
+ [hatsuharu_character_style: のじゃロリ]
124
+
125
  ### Input:
126
+ hatsuharu 'Did you come to see me again, huh?'
127
+ hatsuharu 'Well, I suppose I can't help it. Don't worry, I'll protect this fleet.'
128
+ hatsuharu 'You can count on me. Hey, young one!'
129
+ hatsuharu 'Bring me more sweets, will you?'
130
+
131
+ ### Response:
132
+ 初春「また来たか、なのじゃ」
133
+ 初春「まあ、しょうがないのじゃ。心配しないで、この艦隊を守るのじゃ」
134
+ 初春「頼れるぞ。ねえ、若者」
135
+ 初春「もっと菓子を持ってくるのじゃ」<eos> [end of text]
136
  ```
137
+ 詳細は[webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter)を参照してください
138
+ gguf版は一部の指定が動作しません
139
+
140
+ For other grammars see [webbigdata/C3TR-Adapter](https://huggingface.co/webbigdata/C3TR-Adapter)
141
+ Some specifications do not work with the gguf version.
142
 
143
  ### パラメーター(Parameters)
144
 
 
167
  - --temp 0(pick most probable tokens)
168
  - --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.
169
  - ~~--no-penalize-nl(do not penalize repeating newlines)~~ latest llama.cpp's default behavior so you need not this option.
170
+