shivamjadhav's picture
updated readme
2101025
raw
history blame contribute delete
578 Bytes
from fastapi import FastAPI
from classifier.Albert_latest import get_model
app = FastAPI()
model = get_model()
@app.post("/predict")
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
}
@app.get("/")
async def root():
return {"message": "Welcome to the API. Use /predict to get predictions."}