Spaces:
Romyx
/
Runtime error

Romyx commited on
Commit
e93cbe9
Β·
verified Β·
1 Parent(s): b2cddb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -15,6 +15,18 @@ os.system('python -m unidic download')
15
  # By using XTTS you agree to CPML license https://coqui.ai/cpml
16
  os.environ["COQUI_TOS_AGREED"] = "1"
17
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  # langid is used to detect language for longer text
19
  # Most users expect text to be their own language, there is checkbox to disable it
20
  import langid
 
15
  # By using XTTS you agree to CPML license https://coqui.ai/cpml
16
  os.environ["COQUI_TOS_AGREED"] = "1"
17
 
18
+ # Fix
19
+ _original_load = torch.load
20
+
21
+ # Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΠΎΠ±Π΅Ρ€Ρ‚ΠΊΡƒ, которая ΠΏΡ€ΠΈΠ½ΡƒΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ ставит weights_only=False
22
+ def unsafe_load(*args, **kwargs):
23
+ # Если weights_only Π½Π΅ ΠΏΠ΅Ρ€Π΅Π΄Π°Π½ явно, ставим Π΅Π³ΠΎ Π² False
24
+ if 'weights_only' not in kwargs:
25
+ kwargs['weights_only'] = False
26
+ return _original_load(*args, **kwargs)
27
+ torch.load = unsafe_load
28
+
29
+
30
  # langid is used to detect language for longer text
31
  # Most users expect text to be their own language, there is checkbox to disable it
32
  import langid