meg HF staff commited on
Commit
6c04bde
·
verified ·
1 Parent(s): 9bd745c

Unifying Regis, me, Sasha code to see if it can all come together.

Browse files
Files changed (1) hide show
  1. entrypoint.sh +17 -16
entrypoint.sh CHANGED
@@ -19,23 +19,24 @@ python /parse_requests.py | while read line; do
19
  optimum-benchmark --config-name ${experiment_name} --config-dir /optimum-benchmark/examples/energy_star/ backend.model=${backend_model} backend.processor=${backend_model} hydra.run.dir=${run_dir} 2> $run_dir/error.log
20
 
21
  done || {
22
- echo "Trying the curl thing to get the error logs."
 
23
  curl https://api.hf.space/v1/${SPACE}/logs/run -H "Authorization: Bearer ${DEBUG}" > ./runs/logs-${now}.txt
24
- echo "DID IT WORK?!"
25
- }
26
-
27
- #if [ -s $run_dir/error.log ]; then
28
- # # error.log is not-empty, an error was raised
29
- # echo "An error was raised while benchmarking the model..."
30
- # python /failed_run.py --run_dir $run_dir --model_name $backend_model
31
- #
32
- # # Delete the current run directory so that it is not pushed by create_results.py later
33
- # rm -rf $run_dir
34
- #fi
35
-
36
- # The file is empty, so no error
37
- echo "Finished; uploading dataset results"
38
- python /create_results.py ./runs
39
 
40
  # Pausing space
41
  echo "Pausing space."
 
19
  optimum-benchmark --config-name ${experiment_name} --config-dir /optimum-benchmark/examples/energy_star/ backend.model=${backend_model} backend.processor=${backend_model} hydra.run.dir=${run_dir} 2> $run_dir/error.log
20
 
21
  done || {
22
+ echo "An error occurred while benchmarking the model..."
23
+ echo "Using curl to retrieve the space run log."
24
  curl https://api.hf.space/v1/${SPACE}/logs/run -H "Authorization: Bearer ${DEBUG}" > ./runs/logs-${now}.txt
25
+ python /failed_run.py --run_dir $run_dir --model_name $backend_model
26
+ }
27
+
28
+ if [ -s ./runs/logs-${now}.txt ]; then
29
+ # error.log is not-empty, an error was raised
30
+ echo "An error was raised while benchmarking the model..."
31
+ python /failed_run.py --run_dir $run_dir --model_name $backend_model
32
+
33
+ # # Delete the current run directory so that it is not pushed by create_results.py later
34
+ # rm -rf $run_dir
35
+ else
36
+ # The file is empty, so no error
37
+ echo "Finished; uploading dataset results"
38
+ python /create_results.py ./runs
39
+ fi
40
 
41
  # Pausing space
42
  echo "Pausing space."