Spaces:
Running
Running
Update main.py
#7
by Priyanshi69 - opened
main.py
CHANGED
|
@@ -6,6 +6,8 @@ import gradio as gr
|
|
| 6 |
from TTS.api import TTS
|
| 7 |
from pathlib import Path
|
| 8 |
from datetime import datetime
|
|
|
|
|
|
|
| 9 |
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
OUTPUT_DIR = Path("outputs")
|
|
@@ -14,6 +16,10 @@ HISTORY = []
|
|
| 14 |
|
| 15 |
tts = None
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
def get_tts():
|
| 18 |
global tts
|
| 19 |
if tts is None:
|
|
|
|
| 6 |
from TTS.api import TTS
|
| 7 |
from pathlib import Path
|
| 8 |
from datetime import datetime
|
| 9 |
+
from TTS.tts.configs.xtts_config import XttsConfig
|
| 10 |
+
from TTS.tts.models.xtts import Xtts
|
| 11 |
|
| 12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 13 |
OUTPUT_DIR = Path("outputs")
|
|
|
|
| 16 |
|
| 17 |
tts = None
|
| 18 |
|
| 19 |
+
|
| 20 |
+
# PyTorch 2.6 fix
|
| 21 |
+
torch.serialization.add_safe_globals([XttsConfig])
|
| 22 |
+
|
| 23 |
def get_tts():
|
| 24 |
global tts
|
| 25 |
if tts is None:
|