pplx-embed-v1-0.6b-GGUF
import numpy as np
from llama_cpp import Llama
from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim
model = SentenceTransformer(
"perplexity-ai/pplx-embed-v1-0.6b",
trust_remote_code=True
)
llama = Llama.from_pretrained(
repo_id="mykor/pplx-embed-v1-0.6b-GGUF",
filename="pplx-embed-v1-0.6B-F32.gguf",
verbose=False,
embedding=True,
n_ctx=0,
)
text = """์ด์ ๊นจ์ด๋ ์ค๋ ๋ ์ด๋ง ๋ฐ๋ผ
๊ธฐ๋ค๋ฆฌ๋ ์ค๋์ ๋ง๋ค ๊ฑฐ์ผ
์ด ๋ง์ ์๊ฐ์ ๋ ํ๋ฆฌ๊ณ ์ถ์ง๋ ์์
์ด์ ๋๋ ๋ถ๋ช
ํ ์ค๋น๊ฐ ๋ผ์๋๋ฐ
์ด๋ค ๋ฌด๊ธฐ๋ ฅํจ์ด ์๋
๋์๊ฒ ์๋ฏธ๊ฐ ์์ ๋งํผ
๋๋ค์ wake up ๋ wake up
๋ฌ๊ถ์ ธ ๋ ๋จ๊ฒ๊ฒ
๊ตณ์ด ๋ด์ค ํ์ ์์ด ์ด์ฐจํผ never give up
๋ญ๊ฐ ๋ค๋ฒผ์ค๋ ๋๋ ์ด์ฉ๋ผ ํ๋ฏ์ด
๋ญ๋ ํ ์ ์์ ๊ฑฐ ๊ฐ์
์ด์ ๊นจ์ด๋ ์ค๋ ๋ ์ด ๋ง ๋ฐ๋ผ
๊ธฐ๋ค๋ฆฌ๋ ์ค๋์ ๋ง๋ค ๊ฑฐ์ผ
๋์ ์ฌ์ด์ ํผ์ด๋ ์ด๊ฒจ๋ด์จ ๊ฝ์ฒ๋ผ
๋ถ๋ช
ํผ์๋ผ ๊ฑฐ์ผ ๋๋ฅผ
๋์๊ฒ ๋จ์ ์๋ ๊ฒ ์ผ๋ง ๋์ง ์๋ ๊ฒ ๊ฐ์๋
๋ ๋ฒ ๋ค์ ๋ด๊ฒ ๋ถ๋๋ฝ์ง ์๊ฒ
๋๋ฐ๋ก ๋ด
๊ตณ์ด ๋ด์ค ํ์ ์์ด ์ด์ฐจํผ never give up
๋ญ๊ฐ ๋ค๋ฒผ์ค๋ ๋๋ ์ด์ฉ๋ผ ํ๋ฏ์ด
๋ญ๋ ์ด๊ธธ ์ ์์๊ฑฐ์ผ
์ด์ ๊นจ์ด๋ ์ค๋ ๋ ์ด๋ง ๋ฐ๋ผ
๊ธฐ๋ค๋ฆฌ๋ ์ค๋์ ๋ง๋ค ๊ฑฐ์ผ
๋์ ์ฌ์ด์ ํผ์ด๋ ์ด๊ฒจ๋ด์จ ๊ฝ์ฒ๋ผ
๋ถ๋ช
ํผ์๋ผ ๊ฑฐ์ผ ๋๋ฅผ
Time's up ๋ช ๋ฒ์ํด๋ overcharge
๊ทธ๋งํด๋ ๋๋ค ํด๋
No matter, no matter ์จ์ด ์ฐจ์ฌ๋ผ๋
์ด ๊ธธ์ ๋ฐ๋๋ค๋ฉด
ํ๋ ์ ๋๋จธ ๋ป์ด๊ฐ๋ ๋น ๋ฐ๋ผ
์ด ๋ง์๋ ๋ ๋ ค ๊ณง ๋ฟ์ ๊ฒ๋ง ๊ฐ์
๋์ ์ฌ์ด์ ํผ์ด๋ ์ด๊ฒจ๋ด์จ ๊ฝ์ฒ๋ผ
๋ถ๋ช
ํผ์๋ผ ๊ฑฐ์ผ ๋๋ฅผ"""
def int8_quantize(arr: np.ndarray) -> np.ndarray:
qmin, qmax = -128, 127
tanh_arr = np.tanh(arr)
return np.round(tanh_arr * qmax).clip(qmin, qmax).astype(np.float32)
embed1 = model.encode(text)
embed2 = llama.embed(text)
embed2 = int8_quantize(embed2)
print(cos_sim(embed1, embed2).item())
0.9999861717224121
- Downloads last month
- 470
Hardware compatibility
Log In to add your hardware
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
32-bit
Model tree for mykor/pplx-embed-v1-0.6b-GGUF
Base model
perplexity-ai/pplx-embed-v1-0.6b