Downloads · 30 days
23
20% of all-time downloads
Hzzzzx0/qwen3-0.6b-oral-lora
qwen3-0.6b-oral-lora is a translation model from Hzzzzx0. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as apache-2.0.
This is a LoRA adapter for Qwen/Qwen3-0.6B fine-tuned for bilingual oral translation (Chinese ↔ English).
Downloads · 30 days
23
20% of all-time downloads
All-time downloads
114
Public
Repo size
332 MB
Likes
0
Public
Click a slice to open those files.
.pt221 MB · 57%
From the Hugging Face model README
This is a LoRA adapter for Qwen/Qwen3-0.6B fine-tuned for bilingual oral translation (Chinese ↔ English).
| Model | BLEU Score | Improvement |
|---|---|---|
| Baseline (Qwen3-0.6B) | 1.24 | - |
| LoRA Fine-tuned | 11.89 | +858% |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-0.6B",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "Hzzzzx0/qwen3-0.6b-oral-lora")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B", trust_remote_code=True)
# Translate
def translate(text, direction="zh2en"):
if direction == "zh2en":
inst = "请把下面中文翻译成口语自然的英文。只输出译文。"
else:
inst = "请把下面英文翻译成口语自然的中文。只输出译文。"
prompt = f"### Instruction:\n{inst}\n\n### Input:\n{text}\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
repetition_penalty=1.2,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
result = tokenizer.decode(output[0], skip_special_tokens=True)
return result.split("### Response:")[-1].strip()
# Example
print(translate("你好呀", "zh2en")) # Output: Hi, how are you?
Chinese → English:
English → Chinese:
@misc{qwen3-oral-lora,
title={Qwen3-0.6B Oral Translation LoRA},
author={Hzzzzx0},
year={2025},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/Hzzzzx0/qwen3-0.6b-oral-lora}}
}
Apache 2.0