txya900619 commited on
Commit
91f84ef
1 Parent(s): 95a6068

feat: use zero gpu

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ import TTS
7
  from huggingface_hub import snapshot_download
8
  from omegaconf import OmegaConf
9
  from TTS.utils.synthesizer import Synthesizer
 
10
 
11
  from ipa.ipa import get_ipa, parse_ipa
12
  from replace.tts import ChangedVitsConfig
@@ -44,7 +45,7 @@ OmegaConf.register_new_resolver("load_model", load_model)
44
 
45
  models_config = OmegaConf.to_object(OmegaConf.load("configs/models.yaml"))
46
 
47
-
48
  def _do_tts(model_id, ipa, language_name, speaker_name=None, speaker_wav=None):
49
  model = models_config[model_id]["model"]
50
  if speaker_wav is not None:
 
7
  from huggingface_hub import snapshot_download
8
  from omegaconf import OmegaConf
9
  from TTS.utils.synthesizer import Synthesizer
10
+ import spaces
11
 
12
  from ipa.ipa import get_ipa, parse_ipa
13
  from replace.tts import ChangedVitsConfig
 
45
 
46
  models_config = OmegaConf.to_object(OmegaConf.load("configs/models.yaml"))
47
 
48
+ @spaces.GPU
49
  def _do_tts(model_id, ipa, language_name, speaker_name=None, speaker_wav=None):
50
  model = models_config[model_id]["model"]
51
  if speaker_wav is not None: