Giter Site home page Giter Site logo

eval_sql's Introduction

Guide for our evalution process

We use our single model for evaluation (StarCoder-v2 15B instruct as base model) and LLama 3 tokenizer for preprocessing data.

Prepare All Environments

Pull docker image

docker pull chideptrai/bird_leaderboard
docker run --gpus $gpu_device -i -t  chideptrai/bird_leaderboard  /bin/bash

Download conda environment and update pyarrow (if necessary)

cd ~/text2sql_repo
huggingface-cli download "ambivalent02/sql_env" --local-dir ./submit_env

mv ./submit_env/submit_env.zip . && rm -rf ./submit_env

unzip submit_env.zip && rm submit_env.zip

conda activate ./submit_env

python3 -m pip install -U pyarrow

Step3: Download Checkpoints

#LLM
huggingface-cli download "ambivalent02/sql_15b_vinai" \
--local-dir ./submit_model
#Classifier
huggingface-cli download "ambivalent02/roberta_sql_sic" \
--local-dir ./submit_sic_ckp

Step4: Setup and Pre-process data

# Build BM25 index for each 
python build_contents_index.py \
--db_root_path $path_to_test_database \
--index_path $path_to_save_test_index    

# Pre-process dataset
python prepare_sft_datasets.py \
--dataset $path_to_test_dir\
--db_root_path $path_to_test_database\
--index_path
$path_to_saved_test_index

# Add to null to prompt template
python convert_to_null_format.py \
--dataset ./submit.json \
--db_root_path $path_to_test_database \
--outfile ./submit_null.json

# Convert data to alpaca format 
python convert_sql_to_alpaca.py \
path_to_llama3_model \
"./submit_null.json"

Step5: Run Inference and Evaluation

bash run_evaluation.sh 
"./submit_model" "starcoder" 
"./submit_null_alpaca.json" 

(Example data: ./dev -> replace it with test data)

eval_sql's People

Contributors

baochi0212 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.