Text Generation
PEFT
Safetensors
Transformers
English
Japanese
lora
structured-output
structeval
csv-fix
conversational
Instructions to use tenyyprn/qwen3-4b-structeval-exp15 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use tenyyprn/qwen3-4b-structeval-exp15 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "tenyyprn/qwen3-4b-structeval-exp15") - Transformers
How to use tenyyprn/qwen3-4b-structeval-exp15 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tenyyprn/qwen3-4b-structeval-exp15") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tenyyprn/qwen3-4b-structeval-exp15", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tenyyprn/qwen3-4b-structeval-exp15 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tenyyprn/qwen3-4b-structeval-exp15" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tenyyprn/qwen3-4b-structeval-exp15", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tenyyprn/qwen3-4b-structeval-exp15
- SGLang
How to use tenyyprn/qwen3-4b-structeval-exp15 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tenyyprn/qwen3-4b-structeval-exp15" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tenyyprn/qwen3-4b-structeval-exp15", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tenyyprn/qwen3-4b-structeval-exp15" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tenyyprn/qwen3-4b-structeval-exp15", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tenyyprn/qwen3-4b-structeval-exp15 with Docker Model Runner:
docker model run hf.co/tenyyprn/qwen3-4b-structeval-exp15
Qwen3-4B StructEval Exp15 (CSV Fix)
Exp13 (SFT+DPO) をベースに、CSV変換の問題を修正するための特化LoRAアダプター。
Overview
| Item | Detail |
|---|---|
| Base Model | Qwen/Qwen3-4B-Instruct-2507 |
| Parent Adapter | Exp13 (SFT + DPO, merged) |
| Purpose | CSV出力の「starting with header row」誤解釈を修正 |
| Method | Merged Exp13 + 追加LoRA fine-tuning |
Training Details
Strategy
- Exp13 DPOアダプターをベースモデルにマージ
- マージ後のモデルに対して、CSV修正用の小規模LoRAを追加学習
Hyperparameters
| Parameter | Value |
|---|---|
| Learning Rate | 5e-5 |
| Epochs | 15 |
| Batch Size | 1 |
| Gradient Accumulation | 1 |
| LoRA r | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.05 |
| Target Modules | q/k/v/o_proj, gate/up/down_proj |
| Precision | fp16 |
| Max Sequence Length | 2048 |
| Optimizer | AdamW |
| Seed | 3407 |
Training Data
- CSV修正用データセット(6サンプル)
- 「starting with header row」を正しく解釈し、ヘッダー+データ行を出力する学習
Hardware
- NVIDIA DGX Spark (GB10 Blackwell GPU)
- CUDA 12.1
Inference
System Prompt
You are a structured data expert. Output the requested format directly without any explanation, preamble, or markdown code blocks. Do not write ```json, ```yaml, ```toml, ```xml, ```csv or similar. Output only the raw structured data.
Settings
| Parameter | Value |
|---|---|
| Temperature | 1e-7 (near-greedy) |
| Max New Tokens | 4096 |
| do_sample | False |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "tenyyprn/qwen3-4b-structeval-exp15"
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_id)
model = model.merge_and_unload()
model.eval()
Results
Ensemble (Exp13 + Exp15) の公式コンペスコア: 0.781733
Exp15 単体ローカル評価
| Format | Score |
|---|---|
| JSON | High |
| YAML | High |
| XML | High |
| CSV | Improved (fix applied) |
| TOML | Challenging |
Related Models
- Base: Qwen/Qwen3-4B-Instruct-2507
- Parent (Exp13 DPO): SFT + DPO trained adapter (merged into this model)
License
Apache 2.0 (following base model license)
- Downloads last month
- 2
Model tree for tenyyprn/qwen3-4b-structeval-exp15
Base model
Qwen/Qwen3-4B-Instruct-2507