jhansss commited on
Commit
1c7c6fd
·
1 Parent(s): 69185df

Add GPU decorator to run_pipeline and update_metrics methods in GradioInterface

Browse files
Files changed (1) hide show
  1. interface.py +3 -0
interface.py CHANGED
@@ -2,6 +2,7 @@ import time
2
  import uuid
3
 
4
  import gradio as gr
 
5
  import yaml
6
 
7
  from characters import CHARACTERS
@@ -212,6 +213,7 @@ class GradioInterface:
212
  self.current_voice = self.svs_model_map[self.current_svs_model]["voices"][voice]
213
  return gr.update(value=voice)
214
 
 
215
  def run_pipeline(self, audio_path):
216
  if not audio_path:
217
  return gr.update(value=None), gr.update(value=None)
@@ -228,6 +230,7 @@ class GradioInterface:
228
  value=self.results["output_audio_path"]
229
  )
230
 
 
231
  def update_metrics(self, audio_path):
232
  if not audio_path or not self.results:
233
  return gr.update(value="")
 
2
  import uuid
3
 
4
  import gradio as gr
5
+ import spaces
6
  import yaml
7
 
8
  from characters import CHARACTERS
 
213
  self.current_voice = self.svs_model_map[self.current_svs_model]["voices"][voice]
214
  return gr.update(value=voice)
215
 
216
+ @spaces.GPU
217
  def run_pipeline(self, audio_path):
218
  if not audio_path:
219
  return gr.update(value=None), gr.update(value=None)
 
230
  value=self.results["output_audio_path"]
231
  )
232
 
233
+ @spaces.GPU
234
  def update_metrics(self, audio_path):
235
  if not audio_path or not self.results:
236
  return gr.update(value="")