Vansh Chugh commited on
Commit
b18eb2a
·
1 Parent(s): 02e70e7

add zerogpu decorator

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -11,6 +11,12 @@ import soundfile as sf
11
  import librosa
12
  import gradio as gr
13
 
 
 
 
 
 
 
14
  from pymixconsole.parameter import Parameter
15
  from pymixconsole.parameter_list import ParameterList
16
  from pyharp import ModelCard, build_endpoint
@@ -211,6 +217,7 @@ model_card = ModelCard(
211
  )
212
 
213
 
 
214
  def process_fn(vocals_path, bass_path, drums_path, other_path):
215
  paths = {'vocals': vocals_path, 'bass': bass_path, 'drums': drums_path, 'other': other_path}
216
 
 
11
  import librosa
12
  import gradio as gr
13
 
14
+ try:
15
+ import spaces
16
+ def gpu_decorator(func): return spaces.GPU(func)
17
+ except ImportError:
18
+ def gpu_decorator(func): return func
19
+
20
  from pymixconsole.parameter import Parameter
21
  from pymixconsole.parameter_list import ParameterList
22
  from pyharp import ModelCard, build_endpoint
 
217
  )
218
 
219
 
220
+ @gpu_decorator
221
  def process_fn(vocals_path, bass_path, drums_path, other_path):
222
  paths = {'vocals': vocals_path, 'bass': bass_path, 'drums': drums_path, 'other': other_path}
223