Instructions to use radm/rugpt3medium-tathagata with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use radm/rugpt3medium-tathagata with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="radm/rugpt3medium-tathagata")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("radm/rugpt3medium-tathagata") model = AutoModelForCausalLM.from_pretrained("radm/rugpt3medium-tathagata") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use radm/rugpt3medium-tathagata with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "radm/rugpt3medium-tathagata" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "radm/rugpt3medium-tathagata", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/radm/rugpt3medium-tathagata
- SGLang
How to use radm/rugpt3medium-tathagata 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 "radm/rugpt3medium-tathagata" \ --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": "radm/rugpt3medium-tathagata", "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 "radm/rugpt3medium-tathagata" \ --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": "radm/rugpt3medium-tathagata", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use radm/rugpt3medium-tathagata with Docker Model Runner:
docker model run hf.co/radm/rugpt3medium-tathagata
RuGPT3Medium-tathagata
Model description
This is the model for text generation for Russian based on rugpt3medium_based_on_gpt2.
Intended uses & limitations
Тhis model was trained and run to generate text on RTX 3080
How to use
from transformers import GPT2LMHeadModel, GPT2Tokenizer
import torch
DEVICE = torch.device("cuda:0")
model_name_or_path = "radm/rugpt3medium-tathagata"
tokenizer = GPT2Tokenizer.from_pretrained("sberbank-ai/rugpt3medium_based_on_gpt2")
model = GPT2LMHeadModel.from_pretrained(model_name_or_path).to(DEVICE)
text = "В чем смысл жизни?\n"
input_ids = tokenizer.encode(text, return_tensors="pt").to(DEVICE)
model.eval()
with torch.no_grad():
out = model.generate(input_ids,
do_sample=True,
num_beams=4,
temperature=1.1,
top_p=0.9,
top_k=50,
max_length=250,
min_length=50,
early_stopping=True,
no_repeat_ngram_size=2
)
generated_text = list(map(tokenizer.decode, out))[0]
print()
print(generated_text)
Dataset
Dataset based on summaries of major Buddhist, Hindu and Advaita texts such as:
- Diamond Sutra
- Lankavatara Sutra
- Sri Nisargadatta Maharaj quotes
- Quotes from the Bhagavad Gita
Dataset link: tathagata
- Downloads last month
- 5