Jaward commited on
Commit
c8e2a18
·
verified ·
1 Parent(s): 79ea9e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -38,14 +38,10 @@ os.makedirs(OUTPUT_DIR, exist_ok=True)
38
  logger.info(f"Using output directory: {OUTPUT_DIR}")
39
  os.environ["COQUI_TOS_AGREED"] = "1"
40
 
41
- # Initialize TTS model at the top
42
- try:
43
- device = "cuda" if torch.cuda.is_available() else "cpu"
44
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
45
- logger.info("TTS model initialized on %s", device)
46
- except Exception as e:
47
- logger.error("Failed to initialize TTS model: %s", str(e))
48
- tts = None
49
 
50
  # Define Pydantic model for slide data
51
  class Slide(BaseModel):
 
38
  logger.info(f"Using output directory: {OUTPUT_DIR}")
39
  os.environ["COQUI_TOS_AGREED"] = "1"
40
 
41
+ device = "cuda" if torch.cuda.is_available() else "cpu"
42
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
43
+ logger.info("TTS model initialized on %s", device)
44
+
 
 
 
 
45
 
46
  # Define Pydantic model for slide data
47
  class Slide(BaseModel):