Downloads · 30 days
0
tatasauce4life/qwen3-4b-en2zh-orpo
qwen3-4b-en2zh-orpo is a translation model from tatasauce4life. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
- 模型類型: LoRA Adapter (SFT + ORPO 累積更新) - 基礎模型: unsloth/Qwen3-4B-Base-unsloth-bnb-4bit - SFT 模型來源: tatasauce4life/qwen3-4b-en2zh-lora - 訓練方法: ORPO (Odds Ratio Preference Optimization) - 任務: 英文到中文小說翻譯
Downloads · 30 days
0
Access
Public
Updated Sep 19, 2026
Repo size
276 MB
Likes
0
Public
Click a slice to open those files.
.safetensors264 MB · 96%
From the Hugging Face model README
unsloth/Qwen3-4B-Base-unsloth-bnb-4bittatasauce4life/qwen3-4b-en2zh-lora{
"prompt": "英文原文",
"chosen": "人工譯文(高品質)",
"rejected": "機器翻譯(低品質)"
}
### English
{english_text}
### Chinese
{chinese_translation}
| 參數 | 值 |
|---|---|
| ORPO beta | 0.1 |
| Learning Rate | 5e-06 |
| Epochs | 3 |
| Batch Size | 1 |
| Gradient Accumulation | 16 |
| Max Sequence Length | 1024 |
| LoRA r | 16 |
| LoRA alpha | 32 |
| Epoch | Training Loss | Validation Loss | Runtime | Samples Per Second | Steps Per Second | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen | Nll Loss | Log Odds Ratio | Log Odds Chosen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2.192481 | 2.207566 | 87.730400 | 4.149000 | 4.149000 | -0.151305 | -0.089037 | 0.104396 | -0.062268 | -0.890367 | -1.513045 | 11.665050 | 11.588009 | 2.078586 | -1.289797 | -0.893559 |
| 2 | 2.059469 | 2.058235 | 87.013000 | 4.183000 | 4.183000 | -0.146772 | -0.093681 | 0.153846 | -0.053091 | -0.936810 | -1.467716 | 11.099495 | 11.017453 | 1.938203 | -1.200329 | -0.751637 |
| 3 | 2.045361 | 2.046343 | 86.753700 | 4.196000 | 4.196000 | -0.145903 | -0.094649 | 0.167582 | -0.051254 | -0.946491 | -1.459033 | 10.972804 | 10.889699 | 1.927969 | -1.183748 | -0.723704 |
此模型是 LoRA adapter,包含 SFT + ORPO 的累積更新。
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="tatasauce4life/qwen3-4b-en2zh-orpo",
max_seq_length=1024,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained(
"tatasauce4life/qwen3-4b-en2zh-orpo",
load_in_4bit=True,
)
tokenizer = AutoTokenizer.from_pretrained("tatasauce4life/qwen3-4b-en2zh-orpo")
注意: 此 adapter 的 base model 為
unsloth/Qwen3-4B-Base-unsloth-bnb-4bit。 adapter 包含 SFT 階段與 ORPO 階段的累積權重更新。
prompt = "### English\n{your_english_text}\n### Chinese\n"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
result = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(result)