arita37b commited on
Commit
9068902
Β·
verified Β·
1 Parent(s): 82073ac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -5
README.md CHANGED
@@ -7,17 +7,43 @@ base_model:
7
  ---
8
 
9
 
10
- Gemma2 2b Japanese for Embedding generation. Base model is Gemma2B JPN-IT Fine tuned using triplet loss for Embedding Generation.
11
 
12
- Gemma2 2B is the smallest Japanese LLM,
13
- so very useful for practical topics.
14
- (all other Japanese 7B LLM cannot be used in practical setting for embedding due to high cost).
 
15
 
16
 
17
- Access is public for research purpose.
 
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
+