Tung177/km-vi-translation
Viewer • Updated • 565k • 5
How to use Tung177/Qwen3-1.7B-KmVi-500K-v0.2 with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-1.7B-Base")
model = PeftModel.from_pretrained(base_model, "Tung177/Qwen3-1.7B-KmVi-500K-v0.2")How to use Tung177/Qwen3-1.7B-KmVi-500K-v0.2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Tung177/Qwen3-1.7B-KmVi-500K-v0.2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Tung177/Qwen3-1.7B-KmVi-500K-v0.2")
model = AutoModelForCausalLM.from_pretrained("Tung177/Qwen3-1.7B-KmVi-500K-v0.2", 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]:]))How to use Tung177/Qwen3-1.7B-KmVi-500K-v0.2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Tung177/Qwen3-1.7B-KmVi-500K-v0.2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Tung177/Qwen3-1.7B-KmVi-500K-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Tung177/Qwen3-1.7B-KmVi-500K-v0.2
How to use Tung177/Qwen3-1.7B-KmVi-500K-v0.2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Tung177/Qwen3-1.7B-KmVi-500K-v0.2" \
--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": "Tung177/Qwen3-1.7B-KmVi-500K-v0.2",
"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 "Tung177/Qwen3-1.7B-KmVi-500K-v0.2" \
--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": "Tung177/Qwen3-1.7B-KmVi-500K-v0.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Tung177/Qwen3-1.7B-KmVi-500K-v0.2 with Docker Model Runner:
docker model run hf.co/Tung177/Qwen3-1.7B-KmVi-500K-v0.2
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Tung177/Qwen3-1.7B-KmVi-500K-v0.2")
model = AutoModelForCausalLM.from_pretrained("Tung177/Qwen3-1.7B-KmVi-500K-v0.2", 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]:]))axolotl version: 0.13.0.dev0
# ====== Model Configuration ======
base_model: Qwen/Qwen3-1.7B-Base
load_in_8bit: false
load_in_4bit: true
strict: false
# LoRA
adapter: qlora
lora_r: 32
lora_alpha: 32
lora_target_linear: true
lora_qkv_kernel: true
lora_o_kernel: true
lora_mlp_kernel: true
embeddings_skip_upcast: true
# Integration
xformers_attention: true
plugins:
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_glu_activation: true
liger_layer_norm: true
liger_fused_linear_cross_entropy: true
flash_attention: false
# DeepSpeed
# deepspeed: "/kaggle/working/axolotl/deepspeed_configs/zero2_torch_compile.json"
# ====== Hyperparameter Configuration ======
sample_packing: true
learning_rate: 1.8e-4
sequence_len: 4096
micro_batch_size: 8
gradient_accumulation_steps: 1
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: false
optimizer: adamw_8bit
lr_scheduler: cosine_with_min_lr
lr_scheduler_kwargs: {"min_lr_rate": 0.1}
warmup_ratio: 0.03
weight_decay: 0.01
fp16: true
max_grad_norm: 1.0
num_epochs: 1
save_total_limit: 2
saves_per_epoch: 1
logging_steps: 1
output_dir: /kaggle/working/outputs/qwen-sft-mt-kmvi
chat_template: qwen3
# Dataset
datasets:
- path: Tung177/km-vi-translation
type: chat_template
split: "train"
roles_to_train: ["assistant"]
dataset_prepared_path: last_run_prepared
dataloader_prefetch_factor: 8
dataloader_num_workers: 2
dataloader_pin_memory: true
# ====== Tracking ======
wandb_project: MT-V1
wandb_name: qwen3-1.7B-mt-kmvi-v0.2
wandb_log_model: "false"
This model is a fine-tuned version of Qwen/Qwen3-1.7B-Base on the Tung177/km-vi-translation dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
Base model
Qwen/Qwen3-1.7B-Base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tung177/Qwen3-1.7B-KmVi-500K-v0.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)