Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- multilingual
|
5 |
+
- ar
|
6 |
+
- bg
|
7 |
+
- ca
|
8 |
+
- cs
|
9 |
+
- da
|
10 |
+
- de
|
11 |
+
- el
|
12 |
+
- en
|
13 |
+
- es
|
14 |
+
- et
|
15 |
+
- fa
|
16 |
+
- fi
|
17 |
+
- fr
|
18 |
+
- gl
|
19 |
+
- gu
|
20 |
+
- he
|
21 |
+
- hi
|
22 |
+
- hr
|
23 |
+
- hu
|
24 |
+
- hy
|
25 |
+
- id
|
26 |
+
- it
|
27 |
+
- ja
|
28 |
+
- ka
|
29 |
+
- ko
|
30 |
+
- ku
|
31 |
+
- lt
|
32 |
+
- lv
|
33 |
+
- mk
|
34 |
+
- mn
|
35 |
+
- mr
|
36 |
+
- ms
|
37 |
+
- my
|
38 |
+
- nb
|
39 |
+
- nl
|
40 |
+
- pl
|
41 |
+
- pt
|
42 |
+
- ro
|
43 |
+
- ru
|
44 |
+
- sk
|
45 |
+
- sl
|
46 |
+
- sq
|
47 |
+
- sr
|
48 |
+
- sv
|
49 |
+
- th
|
50 |
+
- tr
|
51 |
+
- uk
|
52 |
+
- ur
|
53 |
+
- vi
|
54 |
+
---
|
55 |
+
|
56 |
+
# paraphrase-multilingual-MiniLM-L12-v2.gguf
|
57 |
+
|
58 |
+
```py
|
59 |
+
import torch
|
60 |
+
from llama_cpp import Llama
|
61 |
+
from sentence_transformers import SentenceTransformer
|
62 |
+
from scipy.spatial.distance import cosine
|
63 |
+
|
64 |
+
model = SentenceTransformer(
|
65 |
+
"paraphrase-multilingual-MiniLM-L12-v2",
|
66 |
+
model_kwargs={"torch_dtype": torch.float16}
|
67 |
+
)
|
68 |
+
llm = Llama.from_pretrained(
|
69 |
+
"mykor/paraphrase-multilingual-MiniLM-L12-v2.gguf",
|
70 |
+
filename="paraphrase-multilingual-MiniLM-L12-118M-v2-F16.gguf",
|
71 |
+
embedding=True,
|
72 |
+
verbose=False,
|
73 |
+
)
|
74 |
+
|
75 |
+
text = "「끝내고 싶어」라고 말하니, 네가 처음으로 웃었어"
|
76 |
+
embed1 = model.encode(text)
|
77 |
+
embed2 = llm.embed(text)
|
78 |
+
print(cosine(embed1, embed2))
|
79 |
+
```
|
80 |
+
|
81 |
+
```sh
|
82 |
+
0.0011532125434331464
|
83 |
+
```
|