thinhlpg commited on
Commit
f784787
1 Parent(s): 8d577af

fix: add spaces dependencies for ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -7,6 +7,7 @@ import uuid
7
  from io import StringIO
8
 
9
  import gradio as gr
 
10
  import torch
11
  import torchaudio
12
  from huggingface_hub import HfApi, hf_hub_download, snapshot_download
@@ -15,7 +16,7 @@ from TTS.tts.models.xtts import Xtts
15
  from vinorm import TTSnorm
16
 
17
  # download for mecab
18
- # os.system("python -m unidic download")
19
 
20
  HF_TOKEN = os.environ.get("HF_TOKEN")
21
  api = HfApi(token=HF_TOKEN)
@@ -88,6 +89,7 @@ def calculate_keep_len(text, lang):
88
  return -1
89
 
90
 
 
91
  def predict(
92
  prompt,
93
  language,
 
7
  from io import StringIO
8
 
9
  import gradio as gr
10
+ import spaces
11
  import torch
12
  import torchaudio
13
  from huggingface_hub import HfApi, hf_hub_download, snapshot_download
 
16
  from vinorm import TTSnorm
17
 
18
  # download for mecab
19
+ os.system("python -m unidic download")
20
 
21
  HF_TOKEN = os.environ.get("HF_TOKEN")
22
  api = HfApi(token=HF_TOKEN)
 
89
  return -1
90
 
91
 
92
+ @spaces.GPU
93
  def predict(
94
  prompt,
95
  language,