run_model_weight_loading_test.sh 712 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. SUCCESS=0
  3. IFS=$'\n' read -d '' -r -a MODEL_CONFIGS < "weight_loading/models.txt"
  4. for MODEL_CONFIG in "${MODEL_CONFIGS[@]}"
  5. do
  6. LOCAL_SUCCESS=0
  7. IFS=', ' read -r -a array <<< "$MODEL_CONFIG"
  8. echo "=== RUNNING MODEL: $MODEL_CONFIG ==="
  9. export QUANTIZATION=${array[0]}
  10. export MODEL_NAME=${array[1]}
  11. export REVISION=${array[2]}
  12. pytest -s weight_loading/test_weight_loading.py || LOCAL_SUCCESS=$?
  13. if [[ $LOCAL_SUCCESS == 0 ]]; then
  14. echo "=== PASSED MODEL: ${MODEL_CONFIG} ==="
  15. else
  16. echo "=== FAILED MODEL: ${MODEL_CONFIG} ==="
  17. fi
  18. SUCCESS=$((SUCCESS + LOCAL_SUCCESS))
  19. done
  20. if [ "${SUCCESS}" -eq "0" ]; then
  21. exit 0
  22. else
  23. exit 1
  24. fi