Downloads · 30 days
17
5% of all-time downloads
tungtungsahuru/Qwen3-4B-IE-DPO-ONLY
Qwen3-4B-IE-DPO-ONLY is a text generation model from tungtungsahuru. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
LoRA Adapter optimized for Information Extraction (ADELIE + DPO) Base Model: Qwen/Qwen3-4B-Instruct-2507
Downloads · 30 days
17
5% of all-time downloads
All-time downloads
312
Public
Repo size
540 MB
Likes
0
Public
Click a slice to open those files.
.safetensors529 MB · 97%
From the Hugging Face model README
LoRA Adapter optimized for Information Extraction (ADELIE + DPO)
Base Model: Qwen/Qwen3-4B-Instruct-2507
Qwen3-4B-ADELIE-DPO는 정보 추출(Information Extraction)에 최적화된 LoRA 어댑터입니다. ADELIE(Adaptive Domain-Expert Learning for Information Extraction) 프레임워크를 기반으로 DPO(Direct Preference Optimization) 방식의 preference alignment 학습을 적용했습니다. 목표는 복잡한 IE 환경에서 정교하고 안정적인 추출 성능 향상입니다.
| 항목 | 값 |
|---|---|
| Base Model | Qwen/Qwen3-4B-Instruct-2507 |
| Training Method | DPO + LoRA |
| GPUs | 2x NVIDIA H100 |
| Precision | BF16 |
| DeepSpeed | Stage 2 |
| Parameter | Value |
|---|---|
| Rank | 128 |
| Alpha | 16 |
| Dropout | 0.05 |
| 항목 | 값 |
|---|---|
| Learning Rate | 5e-5 |
| Scheduler | Cosine |
| Warmup Ratio | 0.03 |
| Weight Decay | 0.0 |
| Epochs | 3 |
| Total Batch Size | 4 |
| Max Sequence Length | 2048 |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-4B-Instruct-2507",
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(
base_model,
"tungtungsahuru/Qwen3-4B-ADELIE-DPO"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.95
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
model = model.merge_and_unload()
model.save_pretrained("./merged_model")
tokenizer.save_pretrained("./merged_model")
generation_config = { "max_new_tokens": 512, "do_sample": True, "temperature": 0.7, "top_p": 0.95, "repetition_penalty": 1.1 }
@article{bai2023qwen,
title = {Qwen Technical Report},
author = {Bai, Jinze and others},
year = {2023},
note = {Preprint}
}
@inproceedings{qi2024adelie,
title = {ADELIE: Aligning Large Language Models on Information Extraction},
author = {Qi, Yunjia and Peng, Hao and Wang, Xiaozhi and Xu, Bin and Hou, Lei and Li, Juanzi},
booktitle = {Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP 2024)},
pages = {7371--7387},
year = {2024},
doi = {10.18653/v1/2024.emnlp-main.419}
}
Apache 2.0 License (Base Model 규정 준수)
문의 사항은 Hugging Face Issues 탭을 통해 남겨주세요.