analyst-v1 / README.md
em908's picture
initial upload: adapter config, tokenizer config, chat template, model card
af9b5ed verified
|
Raw History Blame Contribute Delete
1.46 kB
metadata
library_name: transformers
license: apache-2.0
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
tags:
  - pandas
  - code-generation
  - data-analysis
  - lora

analyst-v1

A LoRA adapter for Qwen2.5-Coder-1.5B-Instruct that writes short pandas code answering questions about a DataFrame df already loaded in scope.

Trained on 613 (schema, question, code) pairs. Every training target was executed against the real DataFrame before being kept: 546 pairs derived from DS-1000, 67 generated against real public Kaggle CSVs. See the companion paper: Every Answer Must Run: Training Small Data-Analyst Models Under Execution Verification.

Measured (150 held-out exec-scored pairs)

arm exec_rate exact_match
Qwen2.5-Coder-1.5B-Instruct 0.533 0.293
+ this adapter 0.620 0.253

Execution rises 8.7 points; exact match against bare-script references falls 4.0 points (the adapter adopts a wrapper-function answer style; see paper section 6 for the mechanism).

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct", torch_dtype="bfloat16").cuda()
model = PeftModel.from_pretrained(base, "em908/analyst-v1")
model = model.merge_and_unload().eval()

Training data

em908/analyst-data (same pair counts, same execution filter).

License

Apache-2.0 (matches the base model).