nikigoli commited on
Commit
41359b1
1 Parent(s): c630ddb

Wrapped installing additional GPU dependencies in function and added spaces.GPU decorator.

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -23,11 +23,15 @@ from enum import Enum
23
  import os
24
  os.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), "tmp")
25
 
 
26
  # Installing dependencies not in requirements.txt
27
- from subprocess import call
28
- with open('./startup.sh', 'rb') as file:
29
- script = file.read()
30
- rc = call(script, shell=True)
 
 
 
31
 
32
  class AppSteps(Enum):
33
  JUST_TEXT = 1
 
23
  import os
24
  os.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), "tmp")
25
 
26
+ @spaces.GPU
27
  # Installing dependencies not in requirements.txt
28
+ def install_add_dependencies():
29
+ from subprocess import call
30
+ with open('./startup.sh', 'rb') as file:
31
+ script = file.read()
32
+ return call(script, shell=True)
33
+
34
+ install_add_dependencies()
35
 
36
  class AppSteps(Enum):
37
  JUST_TEXT = 1