Text Generation
Transformers
Safetensors
Russian
llama
russian
small-language-model
sovereign-ai
instruct
text-generation-inference
Instructions to use longtimedevs/Ru-Small-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use longtimedevs/Ru-Small-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="longtimedevs/Ru-Small-Instruct")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("longtimedevs/Ru-Small-Instruct") model = AutoModelForCausalLM.from_pretrained("longtimedevs/Ru-Small-Instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use longtimedevs/Ru-Small-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "longtimedevs/Ru-Small-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "longtimedevs/Ru-Small-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/longtimedevs/Ru-Small-Instruct
- SGLang
How to use longtimedevs/Ru-Small-Instruct 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 "longtimedevs/Ru-Small-Instruct" \ --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": "longtimedevs/Ru-Small-Instruct", "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 "longtimedevs/Ru-Small-Instruct" \ --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": "longtimedevs/Ru-Small-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use longtimedevs/Ru-Small-Instruct with Docker Model Runner:
docker model run hf.co/longtimedevs/Ru-Small-Instruct
Upload 5 files
Browse files- config.json +6 -6
- model.safetensors +2 -2
- tokenizer.json +0 -0
- tokenizer_config.json +2 -0
config.json
CHANGED
|
@@ -9,15 +9,15 @@
|
|
| 9 |
"eos_token_id": 7,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
-
"hidden_size":
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
-
"intermediate_size":
|
| 15 |
"max_position_embeddings": 512,
|
| 16 |
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
-
"num_attention_heads":
|
| 19 |
-
"num_hidden_layers":
|
| 20 |
-
"num_key_value_heads":
|
| 21 |
"pad_token_id": 0,
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
"rms_norm_eps": 1e-05,
|
|
@@ -28,5 +28,5 @@
|
|
| 28 |
"tie_word_embeddings": true,
|
| 29 |
"transformers_version": "5.14.1",
|
| 30 |
"use_cache": false,
|
| 31 |
-
"vocab_size":
|
| 32 |
}
|
|
|
|
| 9 |
"eos_token_id": 7,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 896,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 2560,
|
| 15 |
"max_position_embeddings": 512,
|
| 16 |
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 14,
|
| 19 |
+
"num_hidden_layers": 16,
|
| 20 |
+
"num_key_value_heads": 2,
|
| 21 |
"pad_token_id": 0,
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
"rms_norm_eps": 1e-05,
|
|
|
|
| 28 |
"tie_word_embeddings": true,
|
| 29 |
"transformers_version": "5.14.1",
|
| 30 |
"use_cache": false,
|
| 31 |
+
"vocab_size": 28672
|
| 32 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b45db05f87033d886959305d674650914037fb78bbb87f7092b1d48267b45b71
|
| 3 |
+
size 330376936
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"bos_token": "<|startoftext|>",
|
| 4 |
"eos_token": "<|я_закончил|>",
|
|
|
|
|
|
|
| 5 |
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
"pad_token": "<|pad|>",
|
| 7 |
"tokenizer_class": "TokenizersBackend",
|
|
|
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"bos_token": "<|startoftext|>",
|
| 4 |
"eos_token": "<|я_закончил|>",
|
| 5 |
+
"is_local": true,
|
| 6 |
+
"local_files_only": false,
|
| 7 |
"model_max_length": 1000000000000000019884624838656,
|
| 8 |
"pad_token": "<|pad|>",
|
| 9 |
"tokenizer_class": "TokenizersBackend",
|