llama_eval.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. eval_path='./data/dev_20240627/dev.json'
  2. db_root_path='./data/dev_20240627/dev_databases/'
  3. ground_truth_path='./data/'
  4. #YOUR_API_KEY='xxx'
  5. #YOUR_API_KEY='yyy'
  6. # Llama model on Hugging Face Hub
  7. # https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
  8. YOUR_API_KEY='huggingface'
  9. model='meta-llama/Llama-3.1-8B-Instruct'
  10. # Fine-tuned Llama model locally
  11. # YOUR_API_KEY='finetuned'
  12. # model='fine_tuning/llama31-8b-text2sql-epochs-3'
  13. # Llama models on Together
  14. #model='meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo'
  15. #model='meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo'
  16. #model='meta-llama/Llama-3.3-70B-Instruct-Turbo'
  17. #model='meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8'
  18. #model='meta-llama/Llama-4-Scout-17B-16E-Instruct'
  19. # Llama models on Llama API
  20. #model='Llama-3.3-8B-Instruct'
  21. #model='Llama-3.3-70B-Instruct'
  22. #model='Llama-4-Maverick-17B-128E-Instruct-FP8'
  23. #model='Llama-4-Scout-17B-16E-Instruct-FP8'
  24. #model="llama31-8b-text-sql-epochs-25"
  25. #model="llama31-8b-text-sql-epochs-3"
  26. #model="llama31-8b-text-sql"
  27. #data_output_path="./output/$model/run_500/no_ft/v3/"
  28. #data_output_path="./output/$model/run_500/ft_epochs-25/v3/"
  29. data_output_path="./output/$model/"
  30. echo "Text2SQL using $model"
  31. python3 -u llama_text2sql.py --db_root_path ${db_root_path} --api_key ${YOUR_API_KEY} \
  32. --model ${model} --eval_path ${eval_path} --data_output_path ${data_output_path}
  33. # Check if llama_text2sql.py exited successfully
  34. if [ $? -eq 0 ]; then
  35. echo "llama_text2sql.py completed successfully. Proceeding with evaluation..."
  36. python3 -u text2sql_eval.py --db_root_path ${db_root_path} --predicted_sql_path ${data_output_path} \
  37. --ground_truth_path ${ground_truth_path} \
  38. --diff_json_path ${eval_path}
  39. echo "Done evaluating $model."
  40. else
  41. echo "Error: llama_text2sql.py failed with exit code $?. Skipping evaluation."
  42. exit 1
  43. fi