Spaces:
Running
Running
from fastapi import FastAPI | |
from classifier.Albert_latest import get_model | |
app = FastAPI() | |
model = get_model() | |
async def predict(issue: str): | |
labels = ["No", "Yes"] | |
predictions,label = model.predict(issue) | |
print(f"Predictions: {predictions}") | |
id = predictions | |
print(f"Predictions: {predictions}") | |
return { | |
"priority 1": str(predictions[0]), | |
"priority 2": str(predictions[1]), | |
"Label":label | |
} | |
async def root(): | |
return {"message": "Welcome to the API. Use /predict to get predictions."} |