Spaces:
Runtime error
Runtime error
# import main things | |
from fastapi import Depends, FastAPI, Body | |
from fastapi.responses import JSONResponse, HTMLResponse | |
from uvicorn import run | |
from utils import predict | |
import datetime | |
# initing things | |
app = FastAPI() | |
async def root(): | |
return JSONResponse({"detail":"Not Found"}, 404) | |
async def v(): return {"v": 5, "l": "https://discord.com/channels/897003441539416115/1094970807635157144/1094970807635157144"} | |
async def resolveGet(): | |
return JSONResponse({"detail":"Use POST instead GET"}, 400) | |
async def resolvePost(data = Body()): | |
print(datetime.datetime.now()) | |
return await predict(data["url"]) | |
run(app, host="0.0.0.0", port=7860) | |