segv11 / local_server.py
ED-Demo's picture
Upload folder using huggingface_hub
face243 verified
raw
history blame contribute delete
386 Bytes
# local_server.py
import uvicorn
from fastapi import FastAPI, Request
from handler import EndpointHandler
app = FastAPI()
handler = EndpointHandler()
@app.post("/")
async def inference(request: Request):
data = await request.json()
result = handler(data)
return result
if __name__ == "__main__":
uvicorn.run("local_server:app", host="0.0.0.0", port=8000, reload=True)