llama_eval.sh 1.7 KB

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