Spaces:
Runtime error
Runtime error
File size: 846 Bytes
dfae564 46dbb69 dfae564 b00bedf dfae564 5b4614a dfae564 b00bedf dfae564 b00bedf dfae564 46dbb69 dfae564 6285f13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# 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()
@app.get("/")
@app.post("/")
async def root():
return JSONResponse({"detail":"Not Found"}, 404)
@app.get("/amino-captcha-ocr/api/v1/autoregister/version")
async def v(): return {"v": 5, "l": "https://discord.com/channels/897003441539416115/1094970807635157144/1094970807635157144"}
@app.get("/amino-captcha-ocr/api/v1/predict")
async def resolveGet():
return JSONResponse({"detail":"Use POST instead GET"}, 400)
@app.post("/amino-captcha-ocr/api/v1/predict")
async def resolvePost(data = Body()):
print(datetime.datetime.now())
return await predict(data["url"])
run(app, host="0.0.0.0", port=7860)
|