giangkh19/qwen-0.5b-pandas-merged
The giangkh19/qwen-0.5b-pandas-merged model is a 0.5 billion parameter language model based on the Qwen2.5-Coder-0.5B-Instruct architecture, fine-tuned by giangkh19. It specializes in converting natural language questions and table schemas into executable pandas queries. With a context length of 32768 tokens, this model achieves a 79.1% exact match accuracy on a 6k pandas evaluation dataset, making it highly effective for text-to-pandas code generation.
Loading preview...
Model Overview
The giangkh19/qwen-0.5b-pandas-merged is a specialized language model, a fine-tuned version of Qwen/Qwen2.5-Coder-0.5B-Instruct (494M parameters). Its core function is to translate natural language questions, given a table schema, into corresponding pandas queries. This particular repository contains the merged model, meaning the LoRA adapters have already been integrated, allowing for direct loading and serving without needing PEFT.
Key Capabilities and Performance
- Text-to-Pandas Conversion: Excels at generating pandas code from user queries and provided table metadata.
- High Accuracy: Achieves 79.1% exact match on a 6,000-sample pandas evaluation benchmark, significantly outperforming the base model which scored 0.0% on pandas format generation.
- Direct Usage: Ready to use out-of-the-box, as LoRA weights are merged into the base model.
- Efficient Training: Trained on 80,000 (prompt, pandas-query) pairs from WikiSQL-style sources using LoRA (r=8) for one epoch, completing in approximately 2 hours 10 minutes on an RTX 3090.
Input/Output Format
The model expects input in a specific format, including the table name and column types, followed by the natural language question. It then outputs a Python string containing the pandas query.
Example Input:
Table Name: table_name_44 (power__kw_ (object), location (object))
What is the Davao's power (kW)?Example Output:
result = table_name_44[table_name_44['location'] == "davao"][['power__kw_']]Limitations
- Training Data Overlap: The evaluation scores are somewhat optimistic due to a known overlap of approximately 699 prompts between the training and evaluation datasets.
- Scope: Primarily trained on single-table, WikiSQL-style English questions. It may not perform well on multi-step analytics or complex real-world pandas DataFrame operations.
- Model Size: As a 0.5B parameter model, it might struggle with highly complex arithmetic filters or unusual data values.