Update README.md
Browse files
README.md
CHANGED
@@ -7,17 +7,43 @@ base_model:
|
|
7 |
---
|
8 |
|
9 |
|
10 |
-
Gemma2 2b Japanese for Embedding generation.
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
15 |
|
16 |
|
17 |
-
|
|
|
18 |
|
19 |
|
|
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
To access it, please contact : kevin noel at uzabase.com
|
22 |
|
23 |
|
|
|
|
|
|
7 |
---
|
8 |
|
9 |
|
10 |
+
Gemma2 2b Japanese for Embedding generation.
|
11 |
|
12 |
+
Base model is Gemma2B JPN-IT published by Google in October 2024.
|
13 |
+
Gemma2 2B JPN is the smallest Japanese LLM,
|
14 |
+
so this is very useful for practical topics.
|
15 |
+
(all other Japanese 7B LLM cannot be used easily for embedding purposes due high inference cost).
|
16 |
|
17 |
|
18 |
+
This version has been lightly fine tuned on triplet dataset and triplet loss
|
19 |
+
and quantized into 4bit GGUF format:
|
20 |
|
21 |
|
22 |
+
Sample
|
23 |
|
24 |
+
|
25 |
+
```
|
26 |
+
class GemmaSentenceEmbeddingGGUF:
|
27 |
+
def init(self, model_path="agguf/gemma-2-2b-jpn-it-embedding.gguf"):
|
28 |
+
self.model = Llama(model_path=model_path, embedding=True)
|
29 |
+
|
30 |
+
def encode(self, sentences: list[str], **kwargs) -> list[np.ndarray]:
|
31 |
+
out = []
|
32 |
+
for sentence in sentences:
|
33 |
+
embedding_result = self.model.create_embedding([sentence])
|
34 |
+
embedding = embedding_result['data'][0]['embedding'][-1]
|
35 |
+
out.append(np.array(embedding))
|
36 |
+
|
37 |
+
return out
|
38 |
+
|
39 |
+
|
40 |
+
se = GemmaSentenceEmbeddingGGUF()
|
41 |
+
se.encode(['γγγ«γ‘γ―γγ±γγ³γ§γγγγγγγγγγγγΎγ'])[0]
|
42 |
+
```
|
43 |
+
|
44 |
+
Access is public for research and discussion purpose.
|
45 |
To access it, please contact : kevin noel at uzabase.com
|
46 |
|
47 |
|
48 |
+
|
49 |
+
|