timarni/MNLP_STEM_IT_HARD
Viewer • Updated • 45.4k • 9
How to use timarni/qwen3_s1k_it_hard with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="timarni/qwen3_s1k_it_hard")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("timarni/qwen3_s1k_it_hard")
model = AutoModelForCausalLM.from_pretrained("timarni/qwen3_s1k_it_hard")
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 timarni/qwen3_s1k_it_hard with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "timarni/qwen3_s1k_it_hard"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "timarni/qwen3_s1k_it_hard",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/timarni/qwen3_s1k_it_hard
How to use timarni/qwen3_s1k_it_hard with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "timarni/qwen3_s1k_it_hard" \
--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": "timarni/qwen3_s1k_it_hard",
"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 "timarni/qwen3_s1k_it_hard" \
--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": "timarni/qwen3_s1k_it_hard",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use timarni/qwen3_s1k_it_hard with Docker Model Runner:
docker model run hf.co/timarni/qwen3_s1k_it_hard
axolotl version: 0.9.2
base_model: timarni/qwen3_s1k
# Automatically upload checkpoint and final model to HF
# hub_model_id: username/custom_model_name
plugins:
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
strict: false
chat_template: qwen3
datasets:
- path: timarni/MNLP_STEM_IT_HARD
type: alpaca
split: train
val_set_size: 0.15
output_dir: ./outputs/qwen3_s1k_it_hard
dataset_prepared_path: last_run_prepared
sequence_len: 2048 # 4096
sample_packing: true
eval_sample_packing: false
pad_to_sequence_len: true
# To be sure that no LORA is done
adapter: null
lora: false
merge_lora: false
wandb_project: mnlp_project
wandb_entity: tim-arni
wandb_watch:
wandb_name: qwen3_s1k_it_hard
wandb_log_model:
gradient_accumulation_steps: 4 # 2
micro_batch_size: 2 # 1
num_epochs: 5
optimizer: adamw_torch
lr_scheduler: cosine
learning_rate: 0.00001 # 0.00005
cosine_min_lr_ratio: 0.1
bf16: auto
tf32: true
gradient_checkpointing: offload
gradient_checkpointing_kwargs:
use_reentrant: false
resume_from_checkpoint:
logging_steps: 1
flash_attention: true
warmup_ratio: 0.03
evals_per_epoch: 4
saves_per_epoch: 2
save_total_limit: 10
weight_decay: 0.001
special_tokens:
This model is a fine-tuned version of timarni/qwen3_s1k on the timarni/MNLP_STEM_IT_HARD dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.0345 | 0.0109 | 1 | 2.0409 |
| 0.1118 | 0.2514 | 23 | 0.1711 |
| 0.0848 | 0.5027 | 46 | 0.1647 |
| 0.0884 | 0.7541 | 69 | 0.1625 |
| 0.1029 | 1.0 | 92 | 0.1623 |
| 0.0555 | 1.2514 | 115 | 0.1616 |
| 0.0767 | 1.5027 | 138 | 0.1618 |
| 0.0743 | 1.7541 | 161 | 0.1612 |
| 0.0747 | 2.0 | 184 | 0.1619 |
| 0.0571 | 2.2514 | 207 | 0.1647 |
| 0.0543 | 2.5027 | 230 | 0.1628 |
| 0.0573 | 2.7541 | 253 | 0.1643 |
| 0.0601 | 3.0 | 276 | 0.1630 |
| 0.057 | 3.2514 | 299 | 0.1641 |
| 0.0438 | 3.5027 | 322 | 0.1647 |
| 0.0564 | 3.7541 | 345 | 0.1648 |
| 0.0677 | 4.0 | 368 | 0.1648 |
| 0.0519 | 4.2514 | 391 | 0.1656 |
| 0.0487 | 4.5027 | 414 | 0.1653 |
| 0.0714 | 4.7541 | 437 | 0.1654 |