Instructions to use minhduc168/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit-Vietnamese-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use minhduc168/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit-Vietnamese-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "minhduc168/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit-Vietnamese-LoRA") - Notebooks
- Google Colab
- Kaggle
Qwen3-VL-2B-Instruct Vietnamese (LoRA Adapter)
Đây là LoRA Adapter được fine-tune để trích xuất thông tin từ hóa đơn, phiếu thu và đơn thuốc tiếng Việt.
Adapter được huấn luyện dựa trên mô hình gốc unsloth/Qwen3-VL-2B-Instruct-bnb-4bit nhằm tối ưu khả năng hiểu tài liệu và trả về dữ liệu có cấu trúc.
📌 Thông tin mô hình
- Loại mô hình: LoRA (Low-Rank Adaptation)
- Pipeline: Image-to-Text
- Mục đích: Trích xuất dữ liệu có cấu trúc (JSON) từ hình ảnh tài liệu y tế và tài chính.
- Ngôn ngữ: Tối ưu cho tiếng Việt
- Dataset huấn luyện: minhduc168/dataset-qwen-vlm-extract-bill
🚀 Ưu điểm của LoRA
- ✅ Kích thước nhỏ — chỉ vài trăm MB thay vì vài GB
- ✅ Load nhanh, giảm yêu cầu VRAM
- ✅ Không làm thay đổi trọng số base model
- ✅ Dễ dàng tiếp tục fine-tune trên dataset riêng
- ✅ Phù hợp cho production hoặc triển khai on-premise
🔧 Hướng dẫn sử dụng
Để sử dụng Adapter này, bạn cần tải base model trước, sau đó nạp LoRA bằng thư viện peft.
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from peft import PeftModel
import torch
base_model_id = "unsloth/Qwen3-VL-2B-Instruct-bnb-4bit"
adapter_id = "minhduc168/Qwen3-VL-2B-Instruct-Vietnamese-LoRA"
# 1️⃣ Load base model
model = Qwen2VLForConditionalGeneration.from_pretrained(
base_model_id,
device_map="auto"
)
# 2️⃣ Load LoRA adapter
model = PeftModel.from_pretrained(model, adapter_id)
# 3️⃣ Load processor
processor = AutoProcessor.from_pretrained(base_model_id)
model.eval()
print("Model và LoRA adapter đã sẵn sàng!")
⚠️ Lưu ý quan trọng
- Bắt buộc phải tải đúng Base Model để adapter hoạt động.
Cài đặt thư viện cần thiết:
pip install peft transformers bitsandbytes
📊 Dataset
Model được huấn luyện trên:minhduc168/dataset-qwen-vlm-extract-bill
Bao gồm:
- Hóa đơn bán lẻ
- Phiếu thu
- Đơn thuốc
- Chứng từ tiếng Việt
Định dạng instruction-following giúp model tạo ra kết quả JSON chính xác và ổn định hơn.
🎯 Use Cases
- Trích xuất thông tin hóa đơn tự động
- Structured OCR
- Document AI tiếng Việt
- Medical / pharmacy bill parsing
- Fintech document processing
📌 Khi nào nên dùng LoRA này?
👉 Khi bạn muốn:
- Giảm chi phí GPU
- Tăng tốc inference
- Tùy chỉnh model theo domain tiếng Việt
- Triển khai linh hoạt mà không cần merge model
🔗 Phiên bản khác
Nếu bạn muốn sử dụng phiên bản đã merge trọng số hoặc GGUF để chạy local, tham khảo tại:minhduc168/Qwen3-VL-2B-Instruct-Vietnamese
License
Apache-2.0
💬 Liên hệ
Nếu có câu hỏi về dataset hoặc quá trình training, vui lòng mở Discussion tại repository này!
- Downloads last month
- 6
Model tree for minhduc168/Qwen3-VL-2B-Instruct-unsloth-bnb-4bit-Vietnamese-LoRA
Base model
Qwen/Qwen3-VL-2B-Instruct