Add evaluation pipeline + Spider external validation#4
Merged
Conversation
…ties for Text-to-SQL Co-authored-by: Cosine <agent@cosine.sh>
… examples with schemas; update tests to use load_spider_schema_map Co-authored-by: Cosine <agent@cosine.sh>
…-dtype) across evaluators; wire through load_model_for_inference; include tests and docs updates Co-authored-by: Cosine <agent@cosine.sh>
…ct methods in eval configs Co-authored-by: Cosine <agent@cosine.sh>
…sses Co-authored-by: Cosine <agent@cosine.sh>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a full evaluation pipeline and a new Spider-based external validation step, including lightweight metrics, offline tests, and reports.
What’s included
Evaluation scripts
Evaluation library (src/text2sql/eval)
Inference wrapper (src/text2sql/infer.py)
Spider evaluation helpers (src/text2sql/eval/spider.py)
Tests and fixtures
Documentation
Outputs and structure
How to run (local, mock and real modes)
Internal evaluation (mock, offline):
python scripts/evaluate_internal.py --mock --val_path data/processed/val.jsonl --out_dir reports/
Internal evaluation (real model, with adapters):
python scripts/evaluate_internal.py
--val_path data/processed/val.jsonl
--base_model mistralai/Mistral-7B-Instruct-v0.1
--adapter_dir /path/to/outputs/adapters
--device auto
--max_examples 200
--temperature 0.0
--top_p 0.9
--max_new_tokens 256
--out_dir reports/
Spider external evaluation (mock offline):
python scripts/evaluate_spider_external.py --mock --out_dir reports/
Spider external evaluation (real, with adapters):
python scripts/evaluate_spider_external.py
--base_model mistralai/Mistral-7B-Instruct-v0.1
--adapter_dir /path/to/outputs/adapters
--device auto
--spider_source xlangai/spider
--schema_source richardr1126/spider-schema
--spider_split validation
--max_examples 200
--out_dir reports/
Notes
Deliverable
Original Task: analytics-copilot-text2sql/zv2rmffkdrch
Author: Brejesh Balakrishnan