Spaces:
Runtime error
Runtime error
from fastapi import FastAPI | |
from fastapi.responses import StreamingResponse | |
from inference import synthesize_voice, load_model | |
import io | |
app = FastAPI() | |
# π γ΅γΌγθ΅·εζγ«γ’γγ«γγγΌγγγ | |
async def startup_event(): | |
load_model() | |
async def voice_endpoint(text: str): | |
wav_bytes = synthesize_voice(text) | |
return StreamingResponse(io.BytesIO(wav_bytes), media_type="audio/wav") | |