JaySenpai commited on
Commit
0639973
·
verified ·
1 Parent(s): b1fa1fc

added root path

Browse files
Files changed (1) hide show
  1. app/main.py +5 -0
app/main.py CHANGED
@@ -26,6 +26,11 @@ le.classes_ = np.load("app/label_classes.npy", allow_pickle=True)
26
  class TextInput(BaseModel):
27
  text: str
28
 
 
 
 
 
 
29
  @app.post("/predict")
30
  async def predict(data: TextInput):
31
  inputs = tokenizer(data.text, return_tensors="pt", truncation=True, padding=True)
 
26
  class TextInput(BaseModel):
27
  text: str
28
 
29
+ @app.get("/")
30
+ def read_root():
31
+ return {"message": "FastAPI backend is live. Go to /docs to test."}
32
+
33
+
34
  @app.post("/predict")
35
  async def predict(data: TextInput):
36
  inputs = tokenizer(data.text, return_tensors="pt", truncation=True, padding=True)