Instructions to use r1char9/ruT5-base-pls with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use r1char9/ruT5-base-pls with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="r1char9/ruT5-base-pls")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("r1char9/ruT5-base-pls") model = AutoModelForSeq2SeqLM.from_pretrained("r1char9/ruT5-base-pls", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use r1char9/ruT5-base-pls with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "r1char9/ruT5-base-pls" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "r1char9/ruT5-base-pls", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/r1char9/ruT5-base-pls
- SGLang
How to use r1char9/ruT5-base-pls 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 "r1char9/ruT5-base-pls" \ --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": "r1char9/ruT5-base-pls", "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 "r1char9/ruT5-base-pls" \ --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": "r1char9/ruT5-base-pls", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use r1char9/ruT5-base-pls with Docker Model Runner:
docker model run hf.co/r1char9/ruT5-base-pls
ruT5-base-pls
A fine-tuned version of ai-forever/ruT5-base
(formerly sberbank-ai/ruT5-base) for text simplification on Russian
text: given a complex sentence, the model generates a simpler paraphrase
that preserves its meaning.
Training data
Training metrics
From train.logs:
| Metric | Value |
|---|---|
| BLEU | 100.0 |
| SARI | 28.699 |
| FKGL | 31.931 |
⚠️ A BLEU score of exactly 100.0 is unusual for a generation task and typically indicates the reported score was computed on a degenerate case (e.g. reference == input, or evaluation on the training set itself) rather than genuine model quality — worth re-checking on a proper held-out test set before treating this as the model's real performance.
Usage
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "r1char9/ruT5-base-pls"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_text = """Война Советского Союза против фашистской Германии и её союзников
(Венгрии, Италии, Румынии, Словакии, Хорватии, Финляндии, Японии);
составная часть Второй мировой войны 1939-1945 гг."""
def example(source, model, tokenizer):
"""
Simplify a complex text with the model.
:param source: complex input text
:param model: the model
:param tokenizer: the tokenizer
:return: simplified text generated by the model
"""
print(f"SOURCE: {source}")
input_ids, attention_mask = tokenizer(source, return_tensors="pt").values()
with torch.no_grad():
output = model.generate(
input_ids=input_ids.to(model.device),
attention_mask=attention_mask.to(model.device),
max_new_tokens=input_ids.size(1) * 2,
min_length=0,
)
return tokenizer.decode(output.squeeze(0), skip_special_tokens=True)
example(input_text, model, tokenizer)
Limitations
- FKGL (Flesch–Kincaid Grade Level) of 31.931 is far higher than typical simplified-text targets (usually single digits) — worth confirming this metric was computed correctly before drawing conclusions from it.
- No license has been specified for this model card — add the appropriate
licensefield before publishing, based on the licenses of the base model and the training datasets used.
- Downloads last month
- 324
Model tree for r1char9/ruT5-base-pls
Base model
ai-forever/ruT5-base