Spaces:
Running
on
Zero
Running
on
Zero
Rename gradio_demo.py to app.py
Browse files- gradio_demo.py → app.py +3 -1
gradio_demo.py → app.py
RENAMED
|
@@ -19,6 +19,7 @@ import soundfile as sf
|
|
| 19 |
import torch
|
| 20 |
import os
|
| 21 |
import traceback
|
|
|
|
| 22 |
|
| 23 |
from vibevoice.modular.configuration_vibevoice import VibeVoiceConfig
|
| 24 |
from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference
|
|
@@ -126,7 +127,7 @@ class VibeVoiceDemo:
|
|
| 126 |
except Exception as e:
|
| 127 |
print(f"Error reading audio {audio_path}: {e}")
|
| 128 |
return np.array([])
|
| 129 |
-
|
| 130 |
def generate_podcast_streaming(self,
|
| 131 |
num_speakers: int,
|
| 132 |
script: str,
|
|
@@ -423,6 +424,7 @@ class VibeVoiceDemo:
|
|
| 423 |
traceback.print_exc()
|
| 424 |
yield None, None, error_msg, gr.update(visible=False)
|
| 425 |
|
|
|
|
| 426 |
def _generate_with_streamer(self, inputs, cfg_scale, audio_streamer):
|
| 427 |
"""Helper method to run generation with streamer in a separate thread."""
|
| 428 |
try:
|
|
|
|
| 19 |
import torch
|
| 20 |
import os
|
| 21 |
import traceback
|
| 22 |
+
import spaces
|
| 23 |
|
| 24 |
from vibevoice.modular.configuration_vibevoice import VibeVoiceConfig
|
| 25 |
from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference
|
|
|
|
| 127 |
except Exception as e:
|
| 128 |
print(f"Error reading audio {audio_path}: {e}")
|
| 129 |
return np.array([])
|
| 130 |
+
@spaces.GPU
|
| 131 |
def generate_podcast_streaming(self,
|
| 132 |
num_speakers: int,
|
| 133 |
script: str,
|
|
|
|
| 424 |
traceback.print_exc()
|
| 425 |
yield None, None, error_msg, gr.update(visible=False)
|
| 426 |
|
| 427 |
+
@spaces.GPU
|
| 428 |
def _generate_with_streamer(self, inputs, cfg_scale, audio_streamer):
|
| 429 |
"""Helper method to run generation with streamer in a separate thread."""
|
| 430 |
try:
|