llama_eval.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. eval_path='../data/dev_20240627/dev.json'
  2. db_root_path='../data/dev_20240627/dev_databases/'
  3. ground_truth_path='../data/'
  4. # Llama models on Llama API
  5. YOUR_API_KEY='YOUR_LLAMA_API_KEY'
  6. model='Llama-3.3-8B-Instruct'
  7. #model='Llama-3.3-70B-Instruct'
  8. #model='Llama-4-Maverick-17B-128E-Instruct-FP8'
  9. #model='Llama-4-Scout-17B-16E-Instruct-FP8'
  10. # Llama model on Hugging Face Hub https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
  11. # YOUR_API_KEY='huggingface'
  12. # model='meta-llama/Llama-3.1-8B-Instruct'
  13. # Fine-tuned Llama models locally
  14. # YOUR_API_KEY='finetuned'
  15. # model='../fine-tuning/final_test/llama31-8b-text2sql-peft-quantized-cot_merged'
  16. data_output_path="./output/$model/"
  17. echo "Text2SQL using $model"
  18. python3 -u llama_text2sql.py --db_root_path ${db_root_path} --api_key ${YOUR_API_KEY} \
  19. --model ${model} --eval_path ${eval_path} --data_output_path ${data_output_path}
  20. # Check if llama_text2sql.py exited successfully
  21. if [ $? -eq 0 ]; then
  22. echo "llama_text2sql.py completed successfully. Proceeding with evaluation..."
  23. python3 -u text2sql_eval.py --db_root_path ${db_root_path} --predicted_sql_path ${data_output_path} \
  24. --ground_truth_path ${ground_truth_path} \
  25. --diff_json_path ${eval_path}
  26. echo "Done evaluating $model."
  27. else
  28. echo "Error: llama_text2sql.py failed with exit code $?. Skipping evaluation."
  29. exit 1
  30. fi