Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -3,7 +3,7 @@ import logging
|
|
| 3 |
import torch
|
| 4 |
import soundfile as sf
|
| 5 |
from transformers import AutoTokenizer, AutoModelForTextToWaveform
|
| 6 |
-
|
| 7 |
# Configure logging
|
| 8 |
logging.basicConfig(level=logging.DEBUG)
|
| 9 |
# Configure logging
|
|
@@ -33,7 +33,7 @@ class EndpointHandler():
|
|
| 33 |
|
| 34 |
# Save the audio to a file
|
| 35 |
sf.write("StoryAudio.wav", outputs["waveform"][0].numpy(), self.model.config.sampling_rate)
|
| 36 |
-
|
| 37 |
return 'StoryAudio.wav'
|
| 38 |
# Check if the request was successful
|
| 39 |
|
|
|
|
| 3 |
import torch
|
| 4 |
import soundfile as sf
|
| 5 |
from transformers import AutoTokenizer, AutoModelForTextToWaveform
|
| 6 |
+
|
| 7 |
# Configure logging
|
| 8 |
logging.basicConfig(level=logging.DEBUG)
|
| 9 |
# Configure logging
|
|
|
|
| 33 |
|
| 34 |
# Save the audio to a file
|
| 35 |
sf.write("StoryAudio.wav", outputs["waveform"][0].numpy(), self.model.config.sampling_rate)
|
| 36 |
+
|
| 37 |
return 'StoryAudio.wav'
|
| 38 |
# Check if the request was successful
|
| 39 |
|