import numpy as np
import requests
import json
defembeding(text):
url = 'http://127.0.0.1:8080/v1/embeddings'
headers = {"Content-Type": "application/json", "Authorization": "no-key"}
data={"input": text,
"model": "BERTA-uncased",
"encoding_format": "float"}
r = requests.post(url, headers=headers, data=json.dumps(data))
emb = np.array([np.array(s['embedding']) for s in r.json()['data']])
return emb
inputs = [
# "paraphrase: В Ярославской области разрешили работу бань, но без посетителей",
"categorize_entailment: Женщину доставили в больницу, за ее жизнь сейчас борются врачи.",
"search_query: Сколько программистов нужно, чтобы вкрутить лампочку?",
# "paraphrase: Ярославским баням разрешили работать без посетителей",
"categorize_entailment: Женщину спасают врачи.",
"search_document: Чтобы вкрутить лампочку, требуется три программиста: один напишет программу извлечения лампочки, другой — вкручивания лампочки, а третий проведет тестирование."
]
embeddings = embeding(inputs)
sim_scores = embeddings[:3] @ embeddings[3:].T
print(sim_scores.diagonal().tolist())
Runs of sergeyzh BERTA-uncased-GGUF on huggingface.co
143
Total runs
0
24-hour runs
26
3-day runs
59
7-day runs
59
30-day runs
More Information About BERTA-uncased-GGUF huggingface.co Model
BERTA-uncased-GGUF huggingface.co is an AI model on huggingface.co that provides BERTA-uncased-GGUF's model effect (), which can be used instantly with this sergeyzh BERTA-uncased-GGUF model. huggingface.co supports a free trial of the BERTA-uncased-GGUF model, and also provides paid use of the BERTA-uncased-GGUF. Support call BERTA-uncased-GGUF model through api, including Node.js, Python, http.
BERTA-uncased-GGUF huggingface.co is an online trial and call api platform, which integrates BERTA-uncased-GGUF's modeling effects, including api services, and provides a free online trial of BERTA-uncased-GGUF, you can try BERTA-uncased-GGUF online for free by clicking the link below.
sergeyzh BERTA-uncased-GGUF online free url in huggingface.co:
BERTA-uncased-GGUF is an open source model from GitHub that offers a free installation service, and any user can find BERTA-uncased-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of BERTA-uncased-GGUF install, users can directly use BERTA-uncased-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.