HuggingFaceFW/fineweb
Viewer • Updated • 52.5B • 1.06M • 2.84k
How to use sergeyzh/rubert-mini-uncased-GGUF with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("sergeyzh/rubert-mini-uncased-GGUF", dtype="auto")How to use sergeyzh/rubert-mini-uncased-GGUF with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sergeyzh/rubert-mini-uncased-GGUF")
sentences = [
"Это счастливый человек",
"Это счастливая собака",
"Это очень счастливый человек",
"Сегодня солнечный день"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]How to use sergeyzh/rubert-mini-uncased-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sergeyzh/rubert-mini-uncased-GGUF", filename="rubert-mini-uncased-f16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
How to use sergeyzh/rubert-mini-uncased-GGUF with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sergeyzh/rubert-mini-uncased-GGUF:F16 # Run inference directly in the terminal: llama-cli -hf sergeyzh/rubert-mini-uncased-GGUF:F16
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sergeyzh/rubert-mini-uncased-GGUF:F16 # Run inference directly in the terminal: llama-cli -hf sergeyzh/rubert-mini-uncased-GGUF:F16
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sergeyzh/rubert-mini-uncased-GGUF:F16 # Run inference directly in the terminal: ./llama-cli -hf sergeyzh/rubert-mini-uncased-GGUF:F16
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sergeyzh/rubert-mini-uncased-GGUF:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf sergeyzh/rubert-mini-uncased-GGUF:F16
docker model run hf.co/sergeyzh/rubert-mini-uncased-GGUF:F16
How to use sergeyzh/rubert-mini-uncased-GGUF with Ollama:
ollama run hf.co/sergeyzh/rubert-mini-uncased-GGUF:F16
How to use sergeyzh/rubert-mini-uncased-GGUF with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sergeyzh/rubert-mini-uncased-GGUF to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sergeyzh/rubert-mini-uncased-GGUF to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sergeyzh/rubert-mini-uncased-GGUF to start chatting
How to use sergeyzh/rubert-mini-uncased-GGUF with Docker Model Runner:
docker model run hf.co/sergeyzh/rubert-mini-uncased-GGUF:F16
How to use sergeyzh/rubert-mini-uncased-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sergeyzh/rubert-mini-uncased-GGUF:F16
lemonade run user.rubert-mini-uncased-GGUF-F16
lemonade list
Оригинальная модель: rubert-mini-uncased
Для запуска модели в качестве сервера необходимо использовать llama.cpp:
llama-server -m rubert-mini-uncased-q8_0.gguf -c 512 -ngl 99 --embedding --port 8080
Возможно использование с LM Studio.
import numpy as np
import requests
import json
def embeding(text):
url = 'http://127.0.0.1:8080/v1/embeddings'
headers = {"Content-Type": "application/json", "Authorization": "no-key"}
data={"input": text,
"model": "rubert-mini-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())
# [0.9365279201944358, 0.8030448289720129, 0.6826768729478850] - rubert-mini-uncased-f32
# [0.9365603574226906, 0.8029491439999603, 0.6826115652313832] - rubert-mini-uncased-f16
# [0.9362014453563489, 0.8019812246234975, 0.6823210638303931] - rubert-mini-uncased-q8_0
# [0.9366128444671631, 0.8030662536621094, 0.6826460957527161] - rubert-mini-uncased (torch)
# [0.9360030293464661, 0.8591322302818298, 0.7285830378532410] - FRIDA
8-bit
16-bit
32-bit
Base model
cointegrated/rubert-tiny2