CohereLabs/aya_collection_language_split
Viewer • Updated • 514M • 14k • 119
How to use inspirebek/qwen3-4b-uzbek-v2-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="inspirebek/qwen3-4b-uzbek-v2-bnb-4bit")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("inspirebek/qwen3-4b-uzbek-v2-bnb-4bit")
model = AutoModelForCausalLM.from_pretrained("inspirebek/qwen3-4b-uzbek-v2-bnb-4bit")
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]:]))How to use inspirebek/qwen3-4b-uzbek-v2-bnb-4bit with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/inspirebek/qwen3-4b-uzbek-v2-bnb-4bit
How to use inspirebek/qwen3-4b-uzbek-v2-bnb-4bit with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit" \
--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": "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit" \
--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": "inspirebek/qwen3-4b-uzbek-v2-bnb-4bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use inspirebek/qwen3-4b-uzbek-v2-bnb-4bit with Docker Model Runner:
docker model run hf.co/inspirebek/qwen3-4b-uzbek-v2-bnb-4bit
bitsandbytes nf4 4-bit quant (~3.4 gb) of inspirebek/qwen3-4b-uzbek-v2. nvidia gpu only; easiest hf-native 4-bit load.
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
tok = AutoTokenizer.from_pretrained("inspirebek/qwen3-4b-uzbek-v2-bnb-4bit")
model = AutoModelForCausalLM.from_pretrained(
"inspirebek/qwen3-4b-uzbek-v2-bnb-4bit",
quantization_config=bnb,
device_map="auto",
)
bitsandbytes nf4 (4-bit normalfloat)bfloat16stage a — fluency (continued pretraining):
yakhyo/uz-wiki · MITtahrirchi/uz-books-v2 · MITtahrirchi/uz-crawl · Apache-2.0stage b — instruct (sft):
saillab/alpaca_uzbek_taco · CC-BY-NC-4.0behbudiy/alpaca-cleaned-uz · CC-BY-4.0UAzimov/uzbek-instruct-llm · Apache-2.0CohereLabs/aya_collection_language_split · Apache-2.0med-alex/qa_mt_ru_to_uzn · unspecifiedmed-alex/qa_mt_tr_to_uzn · unspecified⚠️ licensing note:
saillab/alpaca_uzbek_tacois cc-by-nc-4.0, which restricts commercial use of derivative models. downstream users who need a fully permissive license should retrain without that subset.