ylacombe commited on
Commit
1684ec5
·
verified ·
1 Parent(s): 2a17054

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -11,6 +11,7 @@ from gradio_huggingfacehub_search import HuggingfaceHubSearch
11
  from requests.adapters import HTTPAdapter, Retry
12
 
13
  from analyze import run_dataspeech
 
14
 
15
  MAX_ROWS = 100
16
  T = TypeVar("T")
@@ -49,6 +50,7 @@ def report(next_row_idx: int, num_rows: int) -> Dict[str, float]:
49
  return f"Tagging in progress - {next_row_idx/num_rows*100}% of rows analyzed..."
50
 
51
 
 
52
  def analyze_dataset(dataset: str, audio_column_name: str, text_column_name: str, configuration_name: Optional[str] = None, split_name: Optional[str] = None) -> Tuple[str, List[List[Any]]]:
53
  info_resp = session.get(f"https://datasets-server.huggingface.co/info?dataset={dataset}", timeout=3).json()
54
  if "error" in info_resp:
 
11
  from requests.adapters import HTTPAdapter, Retry
12
 
13
  from analyze import run_dataspeech
14
+ import spaces
15
 
16
  MAX_ROWS = 100
17
  T = TypeVar("T")
 
50
  return f"Tagging in progress - {next_row_idx/num_rows*100}% of rows analyzed..."
51
 
52
 
53
+ @spaces.GPU(duration=80)
54
  def analyze_dataset(dataset: str, audio_column_name: str, text_column_name: str, configuration_name: Optional[str] = None, split_name: Optional[str] = None) -> Tuple[str, List[List[Any]]]:
55
  info_resp = session.get(f"https://datasets-server.huggingface.co/info?dataset={dataset}", timeout=3).json()
56
  if "error" in info_resp: