Olivier-Truong commited on
Commit
9976fb9
1 Parent(s): 5eaa085

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -18,6 +18,11 @@ print(os.listdir("/home/user/.local/lib/python3.10/site-packages/TTS/utils"))
18
  old = open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "r").read()
19
  new_one = old.replace("return torch.load(f, map_location=map_location, **kwargs)", "return torch.load(f, map_location=torch.device('cpu'), **kwargs)")
20
  open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "w").write(new_one)
 
 
 
 
 
21
  try:
22
  print(open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "r").read())
23
  except:
 
18
  old = open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "r").read()
19
  new_one = old.replace("return torch.load(f, map_location=map_location, **kwargs)", "return torch.load(f, map_location=torch.device('cpu'), **kwargs)")
20
  open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "w").write(new_one)
21
+
22
+ old = open("/home/user/.local/lib/python3.10/site-packages/TTS/tts/models/xtts.py", "r").read()
23
+ new_one = old.replace("self.load_state_dict(load_fsspec(model_path)[\"model\"], strict=strict)", "self.load_state_dict(load_fsspec(model_path, ** map_location=self.device ** )[\"model\"], strict=strict)")
24
+ open("/home/user/.local/lib/python3.10/site-packages/TTS/tts/models/xtts.py", "w").write(new_one)
25
+
26
  try:
27
  print(open("/home/user/.local/lib/python3.10/site-packages/TTS/utils/io.py", "r").read())
28
  except: