Spaces:
Sleeping
Sleeping
from fastapi import Depends, FastAPI | |
from .classifier.model import Model, get_model | |
app = FastAPI() | |
async def read_root(issue: str, model: Model = Depends(get_model)): | |
accessibility_confidence, nonaccessibility_confidence = model.predict(issue) | |
return {"Accessibility": str(accessibility_confidence), | |
"Non-accessibility": str(nonaccessibility_confidence)} | |
async def pred(issue: str, model: Model = Depends(get_model)): | |
accessibility_confidence, nonaccessibility_confidence = model.predict(issue) | |
return {"Accessibility": str(accessibility_confidence), | |
"Non-accessibility": str(nonaccessibility_confidence)} | |
# @app.post("/") | |
# async def predict(issue: str, model: Model = Depends(get_model)): | |
# accessibility_confidence, nonaccessibility_confidence = model.predict(issue) | |
# return {"Accessibility": str(accessibility_confidence), | |
# "Non-accessibility": str(nonaccessibility_confidence)} | |