Spaces:
Sleeping
Sleeping
import replicate | |
from pydantic import BaseModel | |
from fastapi import FastAPI | |
class URLPayload(BaseModel): | |
url: str | |
app = FastAPI() | |
def process_audio(url: str): | |
deployment = replicate.deployments.get("meal/incredibly-fast-whisper") | |
prediction = deployment.predictions.create( | |
input={ "audio": url } | |
) | |
prediction.wait() | |
return prediction.output | |
async def process_audio_endpoint(payload: URLPayload): | |
result = process_audio(payload.url) | |
return result | |