Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
unsloth
conversational
Instructions to use Flyoz/asr2_ru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Flyoz/asr2_ru with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Flyoz/asr2_ru") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Flyoz/asr2_ru") model = AutoModelForCausalLM.from_pretrained("Flyoz/asr2_ru", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Flyoz/asr2_ru with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Flyoz/asr2_ru" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Flyoz/asr2_ru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Flyoz/asr2_ru
- SGLang
How to use Flyoz/asr2_ru 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 "Flyoz/asr2_ru" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Flyoz/asr2_ru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Flyoz/asr2_ru" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Flyoz/asr2_ru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Flyoz/asr2_ru with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
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 Flyoz/asr2_ru to start chatting
Install Unsloth Studio (Windows)
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 Flyoz/asr2_ru to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Flyoz/asr2_ru to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Flyoz/asr2_ru", max_seq_length=2048, ) - Docker Model Runner
How to use Flyoz/asr2_ru with Docker Model Runner:
docker model run hf.co/Flyoz/asr2_ru
(Trained with Unsloth)
Browse files- chat_template.jinja +5 -15
- config.json +2 -2
- generation_config.json +1 -1
- special_tokens_map.json +21 -3
- tokenizer.json +1 -1
- tokenizer_config.json +10 -6
chat_template.jinja
CHANGED
|
@@ -1,15 +1,5 @@
|
|
| 1 |
-
{%
|
| 2 |
-
|
| 3 |
-
'
|
| 4 |
-
|
| 5 |
-
' }}{%
|
| 6 |
-
' + message['content'] + '<|im_end|>
|
| 7 |
-
' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 8 |
-
' }}{% endif %}{% else %}{% for message in messages %}{% if message['from'] == 'human' %}{{'<|im_start|>user
|
| 9 |
-
' + message['value'] + '<|im_end|>
|
| 10 |
-
'}}{% elif message['from'] == 'gpt' %}{{'<|im_start|>assistant
|
| 11 |
-
' + message['value'] + '<|im_end|>
|
| 12 |
-
' }}{% else %}{{ '<|im_start|>system
|
| 13 |
-
' + message['value'] + '<|im_end|>
|
| 14 |
-
' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 15 |
-
' }}{% endif %}{% endif %}
|
|
|
|
| 1 |
+
{{ bos_token }}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>
|
| 2 |
+
|
| 3 |
+
'+ message['content'] | trim + '<|eot_id|>' %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
|
| 4 |
+
|
| 5 |
+
' }}{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -34,8 +34,8 @@
|
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": false,
|
| 36 |
"torch_dtype": "bfloat16",
|
| 37 |
-
"transformers_version": "4.
|
| 38 |
-
"unsloth_version": "2025.6.
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 128256
|
| 41 |
}
|
|
|
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": false,
|
| 36 |
"torch_dtype": "bfloat16",
|
| 37 |
+
"transformers_version": "4.53.1",
|
| 38 |
+
"unsloth_version": "2025.6.12",
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 128256
|
| 41 |
}
|
generation_config.json
CHANGED
|
@@ -10,5 +10,5 @@
|
|
| 10 |
"pad_token_id": 128004,
|
| 11 |
"temperature": 0.6,
|
| 12 |
"top_p": 0.9,
|
| 13 |
-
"transformers_version": "4.
|
| 14 |
}
|
|
|
|
| 10 |
"pad_token_id": 128004,
|
| 11 |
"temperature": 0.6,
|
| 12 |
"top_p": 0.9,
|
| 13 |
+
"transformers_version": "4.53.1"
|
| 14 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,5 +1,23 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token":
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|begin_of_text|>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|eot_id|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<|reserved_special_token_0|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
}
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 17209920
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
|
| 3 |
size 17209920
|
tokenizer_config.json
CHANGED
|
@@ -73,7 +73,7 @@
|
|
| 73 |
"special": true
|
| 74 |
},
|
| 75 |
"128009": {
|
| 76 |
-
"content": "<|
|
| 77 |
"lstrip": false,
|
| 78 |
"normalized": false,
|
| 79 |
"rstrip": false,
|
|
@@ -2050,11 +2050,15 @@
|
|
| 2050 |
}
|
| 2051 |
},
|
| 2052 |
"bos_token": "<|begin_of_text|>",
|
| 2053 |
-
"clean_up_tokenization_spaces":
|
| 2054 |
-
"eos_token": "<|
|
| 2055 |
"extra_special_tokens": {},
|
| 2056 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2057 |
"pad_token": "<|reserved_special_token_0|>",
|
| 2058 |
-
"
|
| 2059 |
-
"
|
| 2060 |
}
|
|
|
|
| 73 |
"special": true
|
| 74 |
},
|
| 75 |
"128009": {
|
| 76 |
+
"content": "<|eot_id|>",
|
| 77 |
"lstrip": false,
|
| 78 |
"normalized": false,
|
| 79 |
"rstrip": false,
|
|
|
|
| 2050 |
}
|
| 2051 |
},
|
| 2052 |
"bos_token": "<|begin_of_text|>",
|
| 2053 |
+
"clean_up_tokenization_spaces": true,
|
| 2054 |
+
"eos_token": "<|eot_id|>",
|
| 2055 |
"extra_special_tokens": {},
|
| 2056 |
+
"model_input_names": [
|
| 2057 |
+
"input_ids",
|
| 2058 |
+
"attention_mask"
|
| 2059 |
+
],
|
| 2060 |
+
"model_max_length": 131072,
|
| 2061 |
"pad_token": "<|reserved_special_token_0|>",
|
| 2062 |
+
"padding_side": "right",
|
| 2063 |
+
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 2064 |
}
|