Flux9665 commited on
Commit
13fc065
·
1 Parent(s): 6a66802

try to figure out how ZeroGPU works

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -21,16 +21,15 @@ from Utility.storage_config import MODELS_DIR
21
 
22
  class ControllableInterface(torch.nn.Module):
23
 
24
- @spaces.GPU
25
  def __init__(self, available_artificial_voices=1000):
26
  super().__init__()
27
- self.model = ToucanTTSInterface(device="cuda", tts_model_path="Meta")
28
- self.wgan = GanWrapper(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt"), device="cuda")
29
  self.generated_speaker_embeds = list()
30
  self.available_artificial_voices = available_artificial_voices
31
  self.current_language = ""
32
  self.current_accent = ""
33
- self.device="cpu"
34
  self.model.to("cpu")
35
  self.model.device = "cpu"
36
  self.wgan.to("cpu")
 
21
 
22
  class ControllableInterface(torch.nn.Module):
23
 
 
24
  def __init__(self, available_artificial_voices=1000):
25
  super().__init__()
26
+ self.model = ToucanTTSInterface(device="cpu", tts_model_path="Meta")
27
+ self.wgan = GanWrapper(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt"), device="cuda" if torch.cuda.is_available() else "cpu")
28
  self.generated_speaker_embeds = list()
29
  self.available_artificial_voices = available_artificial_voices
30
  self.current_language = ""
31
  self.current_accent = ""
32
+ self.device = "cpu"
33
  self.model.to("cpu")
34
  self.model.device = "cpu"
35
  self.wgan.to("cpu")