Spaces:
Sleeping
Sleeping
Commit
·
8d2bba4
1
Parent(s):
7fea159
minor details fixed
Browse files- App/app.py +3 -3
App/app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from fastapi import FastAPI, UploadFile
|
| 2 |
-
from fastapi.responses import StreamingResponse
|
| 3 |
import torch
|
| 4 |
from transformers import pipeline
|
| 5 |
import tempfile
|
|
@@ -63,8 +63,8 @@ async def text_to_speech(payload: dict):
|
|
| 63 |
buffer = BytesIO()
|
| 64 |
wav_write(buffer, sample_rate, audio)
|
| 65 |
buffer.seek(0)
|
| 66 |
-
return
|
| 67 |
-
buffer,
|
| 68 |
media_type="audio/wav"
|
| 69 |
)
|
| 70 |
|
|
|
|
| 1 |
from fastapi import FastAPI, UploadFile
|
| 2 |
+
from fastapi.responses import StreamingResponse,Response
|
| 3 |
import torch
|
| 4 |
from transformers import pipeline
|
| 5 |
import tempfile
|
|
|
|
| 63 |
buffer = BytesIO()
|
| 64 |
wav_write(buffer, sample_rate, audio)
|
| 65 |
buffer.seek(0)
|
| 66 |
+
return Response(
|
| 67 |
+
content=buffer.read(),
|
| 68 |
media_type="audio/wav"
|
| 69 |
)
|
| 70 |
|