Text Generation
PEFT
Safetensors
Vietnamese
English
lora
text-to-sql
financial
sqlite
unsloth
conversational
Instructions to use giangkh19/Qwen3.5-4B-Financial-SQL-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use giangkh19/Qwen3.5-4B-Financial-SQL-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "giangkh19/Qwen3.5-4B-Financial-SQL-LoRA") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
🔧 Qwen3.5-4B-Financial-SQL-LoRA (PEFT Adapter)
Trọng số LoRA Adapter (dung lượng cực nhẹ ~30 MB) chuyên biệt cho Text-to-SQL Báo Cáo Tài Chính Việt Nam, được tinh chỉnh trên kiến trúc Qwen/Qwen3.5-4B.
⚙️ Cấu hình LoRA (Hyperparameters)
- Rank (r): 16
- Alpha (alpha): 32
- Dropout: 0.0
- Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - Trainable Parameters: ~20M parameters (< 0.5% tổng số tham số của model)
- Epochs: 3 (627 steps) | Final Loss:
0.0978
🚀 Cách nạp Adapter vào Base Model (Unsloth / PEFT)
import torch
from unsloth import FastLanguageModel
# 1. Nạp Base Model dạng 4-bit (chỉ tốn ~2.5GB VRAM)
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="Qwen/Qwen3.5-4B",
max_seq_length=2048,
load_in_4bit=True,
)
# 2. Gắn LoRA Adapter từ Hugging Face
model = FastLanguageModel.get_peft_model(model)
model.load_adapter("giangkh19/Qwen3.5-4B-Financial-SQL-LoRA")
FastLanguageModel.for_inference(model)
# 3. Suy luận
prompt = "<|im_start|>user\nTổng tài sản năm 2023 của Vinamilk (VNM) là bao nhiêu?<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.01)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
- Downloads last month
- 32