CoolFace
Apppublic

Turkeyengineer/test

sourceHugging Faceopenrailupdated 1y agoView on Hugging Face
0likes
app.py14 linesDownload Raw Back to root
1from fastapi import FastAPI, Request2from fastapi.responses import JSONResponse3 4app = FastAPI()5 6@app.post("/run_predict")7async def run_predict(request: Request):8    try:9        body = await request.json()10        sentences = body.get("data", [])11        results = [" / ".join(list(s)) for s in sentences]12        return JSONResponse(content={"data": results})13    except Exception as e:14        return JSONResponse(content={"error": str(e)}, status_code=500)