File size: 3,548 Bytes
264b54b
 
 
 
 
72eb4d6
 
28f8f29
0f5a576
28f8f29
 
0f5a576
7d1e1b4
 
28f8f29
 
 
 
 
7d1e1b4
 
 
 
 
 
 
 
1c557fd
 
7d1e1b4
 
1c557fd
7d1e1b4
 
 
28f8f29
7d1e1b4
28f8f29
 
 
7d1e1b4
 
 
72eb4d6
 
 
 
 
 
 
 
 
 
 
 
0f5a576
28f8f29
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
tags:
- gemma
- llm
---
gemma-2-27b-itを日本語が多く含まれる重要度行列(iMatrix)を使って量子化したgguf版です。日本語対応能力が多めに保持されている事を期待していますが確かめる事はまだ出来ていません  
This is a quantized gguf version of gemma-2-27b-it using an importance matrix (iMatrix) that contains many Japanese words.
I hope it retains more Japanese support, but I can't be sure yet.  

gemma-2-27b-it-Q4_K_M.ggufは最近のCPU(Ryzen 9 7940HS Processor)であれば3トークン/秒程度の速度で実行する事が確認できています。  
It has been confirmed that gemma-2-27b-it-Q4_K_M.gguf runs at about 3 tokens/second on a recent CPU (Ryzen 9 7940HS Processor).  

## 使い方(How to use) 

### ブラウザインタフェース (browser)

Windows11のターミナル(CMD, Power shell)では日本語が化けてしまうのでブラウザを使ってください  
Please use a browser as Japanese characters will be garbled in the Windows 11 terminal (CMD, Power shell).  

[公式マニュアル](https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md)に従ってllama.cppをビルドします  
Build llama.cpp according to the [official manual](https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md)  

ダウンロードしたモデルを指定して下記コマンドを実行します
```
llama.cpp\build\bin\Release\llama-server -m .\gemma-2-27b-it-Q4_K_M.gguf
```

ブラウザでhttp://127.0.0.1:8080を開きます  
Open http://127.0.0.1:8080 in your browser  


![image/png](https://cdn-uploads.huggingface.co/production/uploads/630469550907b9a115c91e62/vKxpBpEcKW6W7AnlCDgOd.png)

![image/png](https://cdn-uploads.huggingface.co/production/uploads/630469550907b9a115c91e62/2eEhTIluRSLIPKrJCLsUw.png)

### コマンドライン (Command Line)

```
llama-cli -m gemma-2-27b-it-Q4_K_M.gguf -e --temp 0 --repeat-penalty 1.0 -n -2 -p "<start_of_turn>user\nWrite a hello world program<end_of_turn>\n<start_of_turn>model"
```

## その他の疑問など Other questions etc.

Q4_K_Mをwiki.test.raw(英語)を使って計測したperplexityスコアが他の同等GGUF量子化モデルに比べて優れている事は確認済ですが理由はまだわかりません。  
I have already confirmed that the perplexity score of Q4_K_M measured using wiki.test.raw is superior to other equivalent GGUF quantization models, but I don't know why yet.  

解明されていない疑問はあります  
There are unanswered questions.  

- llama.cppの不具合対応がほぼ完了した後に作成したからperplexityが低くなったのか?
- (Was the perplexity low because it was created after the llama.cpp defects were almost completed?)
- iMatrixは量子化強度が高いモデルでなければ効果があまりないという説もあるが多言語の観点からもそれは正しいのか?
- (Some say that iMatrix is not very effective unless the model has high quantization strength, but is that true from a multilingual point of view)
- wiki.test.raw(英語)でperplexityを計測することにどこまで意味があるのか?
- (How far does it make sense to measure perplexity with wiki.test.raw (English)?)

## その他の版

同じ手法で作った[gemma-2-9b-it](https://huggingface.co/dahara1/gemma-2-9b-it-gguf-japanese-imatrix)も存在します  
There is also [gemma-2-9b-it](https://huggingface.co/dahara1/gemma-2-9b-it-gguf-japanese-imatrix) made using the same technique.