woolbot's picture
Update main.py
852b422
raw
history blame contribute delete
No virus
324 Bytes
from fastapi import FastAPI, Body
from uvicorn import run
from utils import predict
app = FastAPI()
@app.post("/predict")
async def resolvePost(data = Body()):
return await predict(data["url"])
@app.get("/predict")
async def resolveGet(url: str):
return await predict(url)
run(app, host="0.0.0.0", port=7860)