Commit ·
1a6a41a
1
Parent(s): c74f8e0
added format
Browse files- handler.py +3 -1
handler.py
CHANGED
|
@@ -55,7 +55,9 @@ class EndpointHandler:
|
|
| 55 |
enable_text_splitting=True,
|
| 56 |
)
|
| 57 |
audio_file = io.BytesIO()
|
| 58 |
-
torchaudio.save(
|
|
|
|
|
|
|
| 59 |
inference_time = time.time() - t0
|
| 60 |
print(f"I: Time to generate audio: {inference_time} seconds")
|
| 61 |
audio_str = base64.b64encode(audio_file.getvalue()).decode("utf-8")
|
|
|
|
| 55 |
enable_text_splitting=True,
|
| 56 |
)
|
| 57 |
audio_file = io.BytesIO()
|
| 58 |
+
torchaudio.save(
|
| 59 |
+
audio_file, torch.tensor(out["wav"]).unsqueeze(0), 24000, format="wav"
|
| 60 |
+
)
|
| 61 |
inference_time = time.time() - t0
|
| 62 |
print(f"I: Time to generate audio: {inference_time} seconds")
|
| 63 |
audio_str = base64.b64encode(audio_file.getvalue()).decode("utf-8")
|