Update handler.py
Browse files- handler.py +1 -6
handler.py
CHANGED
|
@@ -11,8 +11,6 @@ logging.basicConfig(level=logging.ERROR)
|
|
| 11 |
# Configure logging
|
| 12 |
logging.basicConfig(level=logging.WARNING)
|
| 13 |
|
| 14 |
-
from pydub import AudioSegment
|
| 15 |
-
from pydub.playback import play
|
| 16 |
|
| 17 |
|
| 18 |
class EndpointHandler():
|
|
@@ -34,10 +32,7 @@ class EndpointHandler():
|
|
| 34 |
|
| 35 |
# Save the audio to a file
|
| 36 |
sf.write("StoryAudio.wav", outputs["waveform"][0].numpy(), self.model.config.sampling_rate)
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
# Play the audio file
|
| 40 |
-
play(audio)
|
| 41 |
return 'StoryAudio.wav'
|
| 42 |
# Check if the request was successful
|
| 43 |
|
|
|
|
| 11 |
# Configure logging
|
| 12 |
logging.basicConfig(level=logging.WARNING)
|
| 13 |
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
class EndpointHandler():
|
|
|
|
| 32 |
|
| 33 |
# Save the audio to a file
|
| 34 |
sf.write("StoryAudio.wav", outputs["waveform"][0].numpy(), self.model.config.sampling_rate)
|
| 35 |
+
|
|
|
|
|
|
|
|
|
|
| 36 |
return 'StoryAudio.wav'
|
| 37 |
# Check if the request was successful
|
| 38 |
|