Spaces:
Runtime error
Runtime error
Fix Gradio runtime errors
Browse files
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,
|
| 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 |
-
)
|
| 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 |
-
)
|
| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
)
|