Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -248,6 +248,8 @@ save_path = "/content/drive/My Drive/fine_tuned_tacotron2.pth"
|
|
248 |
# Save the model's state dictionary using torch.save
|
249 |
torch.save(model.state_dict(), save_path)
|
250 |
|
|
|
|
|
251 |
import librosa
|
252 |
import soundfile as sf
|
253 |
|
@@ -259,7 +261,6 @@ def adjust_pitch(audio_path, pitch_factor):
|
|
259 |
# Save adjusted audio
|
260 |
sf.write(audio_path, y_shifted, sr)
|
261 |
|
262 |
-
"""Set up the Gradio interface"""
|
263 |
|
264 |
import gradio as gr
|
265 |
from transformers import pipeline
|
@@ -283,6 +284,7 @@ emotion_settings = {
|
|
283 |
"shame": {"pitch": 0.8, "speed": 0.85},
|
284 |
}
|
285 |
|
|
|
286 |
# Function to process text or file input and generate audio
|
287 |
def emotion_aware_tts_pipeline(input_text=None, file_input=None):
|
288 |
try:
|
|
|
248 |
# Save the model's state dictionary using torch.save
|
249 |
torch.save(model.state_dict(), save_path)
|
250 |
|
251 |
+
|
252 |
+
"""Set up the Gradio interface"""
|
253 |
import librosa
|
254 |
import soundfile as sf
|
255 |
|
|
|
261 |
# Save adjusted audio
|
262 |
sf.write(audio_path, y_shifted, sr)
|
263 |
|
|
|
264 |
|
265 |
import gradio as gr
|
266 |
from transformers import pipeline
|
|
|
284 |
"shame": {"pitch": 0.8, "speed": 0.85},
|
285 |
}
|
286 |
|
287 |
+
|
288 |
# Function to process text or file input and generate audio
|
289 |
def emotion_aware_tts_pipeline(input_text=None, file_input=None):
|
290 |
try:
|