Instructions to use SiberiaSoft/ruGPT3_medium_chitchat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SiberiaSoft/ruGPT3_medium_chitchat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SiberiaSoft/ruGPT3_medium_chitchat")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SiberiaSoft/ruGPT3_medium_chitchat", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SiberiaSoft/ruGPT3_medium_chitchat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SiberiaSoft/ruGPT3_medium_chitchat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SiberiaSoft/ruGPT3_medium_chitchat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SiberiaSoft/ruGPT3_medium_chitchat
- SGLang
How to use SiberiaSoft/ruGPT3_medium_chitchat with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SiberiaSoft/ruGPT3_medium_chitchat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SiberiaSoft/ruGPT3_medium_chitchat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SiberiaSoft/ruGPT3_medium_chitchat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SiberiaSoft/ruGPT3_medium_chitchat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SiberiaSoft/ruGPT3_medium_chitchat with Docker Model Runner:
docker model run hf.co/SiberiaSoft/ruGPT3_medium_chitchat
Модель русскозычного чат бота, работающая в режиме чит-чат (без контекста предыдущих сообщений)
Пример работы с моделью:
import torch
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained('SiberiaSoft/ruGPT3_medium_chitchat')
model = AutoModelWithLMHead.from_pretrained('SiberiaSoft/ruGPT3_medium_chitchat')
inputs = tokenizer('[FIRST] Привет [SECOND]', return_tensors='pt')
generated_token_ids = model.generate(
**inputs,
top_k=10,
top_p=0.95,
num_beams=3,
num_return_sequences=5,
do_sample=True,
no_repeat_ngram_size=2,
temperature=1.0,
repetition_penalty=1.2,
length_penalty=1.0,
eos_token_id=50257,
max_length = 400
)
generation = [tokenizer.decode(sample_token_ids) for sample_token_ids in generated_token_ids]
print(generation)
- Downloads last month
- 227