Instructions to use em908/analyst-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use em908/analyst-v1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("em908/analyst-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from em908/analyst-v1: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/em908/analyst-v1/resolve/main/README.md
- Command line
-
hf download hf://em908/analyst-v1/README.md
-
curl -L -o README.md https://huggingface.co/em908/analyst-v1/resolve/main/README.md
1.46 kB
| 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 | |
| ```python | |
| 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). | |