Spaces:
r3gm
/
Running

r3gm commited on
Commit
c47eb43
1 Parent(s): f68cd82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -8,15 +8,14 @@ os.environ["OPENBLAS_NUM_THREADS"] = "1"
8
  os.environ["no_proxy"] = "localhost, 127.0.0.1, ::1"
9
 
10
  # Download models
11
- import subprocess
12
  shell_script = './tools/dlmodels.sh'
 
13
  try:
14
- subprocess.run(shell_script, shell=True, check=True)
15
- print("Shell script executed successfully.")
16
- except subprocess.CalledProcessError as e:
17
- print(f"Error running shell script: {e}")
18
- except FileNotFoundError:
19
- print(f"Shell script not found: {shell_script}")
20
  except Exception as e:
21
  print(f"An error occurred: {e}")
22
 
 
8
  os.environ["no_proxy"] = "localhost, 127.0.0.1, ::1"
9
 
10
  # Download models
 
11
  shell_script = './tools/dlmodels.sh'
12
+
13
  try:
14
+ return_code = os.system(shell_script)
15
+ if return_code == 0:
16
+ print("Shell script executed successfully.")
17
+ else:
18
+ print(f"Shell script failed with return code {return_code}")
 
19
  except Exception as e:
20
  print(f"An error occurred: {e}")
21