mbellan commited on
Commit
a6aecee
·
1 Parent(s): d6c45f2

Fix Gradio runtime errors

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -11,7 +11,7 @@ import torch
11
  import torchaudio
12
  import gradio as gr
13
  from pathlib import Path
14
- from typing import Optional, Tuple, List, Dict
15
  from datetime import datetime
16
  import shutil
17
 
@@ -70,7 +70,7 @@ class VoiceModelTrainer:
70
  algorithm: str,
71
  batch_size: int,
72
  progress=None
73
- ) -> Tuple[str, str, str]:
74
  """Train the model with RL."""
75
  if self.training_active:
76
  return "⚠️ Training already in progress", None, None
@@ -190,7 +190,7 @@ class VoiceModelTrainer:
190
  checkpoint_path: str,
191
  sample_audio: str,
192
  progress=None
193
- ) -> Tuple[str, str, str]:
194
  """Generate audio comparison."""
195
  try:
196
  if not checkpoint_path or not Path(checkpoint_path).exists():
@@ -453,4 +453,10 @@ def create_app():
453
 
454
  if __name__ == "__main__":
455
  app = create_app()
456
- app.launch()
 
 
 
 
 
 
 
11
  import torchaudio
12
  import gradio as gr
13
  from pathlib import Path
14
+ from typing import Optional, List, Dict
15
  from datetime import datetime
16
  import shutil
17
 
 
70
  algorithm: str,
71
  batch_size: int,
72
  progress=None
73
+ ):
74
  """Train the model with RL."""
75
  if self.training_active:
76
  return "⚠️ Training already in progress", None, None
 
190
  checkpoint_path: str,
191
  sample_audio: str,
192
  progress=None
193
+ ):
194
  """Generate audio comparison."""
195
  try:
196
  if not checkpoint_path or not Path(checkpoint_path).exists():
 
453
 
454
  if __name__ == "__main__":
455
  app = create_app()
456
+ app.queue()
457
+ app.launch(
458
+ server_name="0.0.0.0",
459
+ server_port=7860,
460
+ share=False,
461
+ show_api=False
462
+ )