Akbartus commited on
Commit
c4ed287
·
verified ·
1 Parent(s): 42ca00e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -3
main.py CHANGED
@@ -1,5 +1,4 @@
1
  from fastapi import FastAPI
2
- from fastapi.responses import JSONResponse
3
  from pydantic import BaseModel
4
  from transformers import pipeline
5
 
@@ -18,5 +17,5 @@ async def classify_text(text):
18
 
19
  @app.post("/classify")
20
  async def classify(payload: Payload):
21
- result = await classify_text(payload.text)
22
- return JSONResponse({"data": result})
 
1
  from fastapi import FastAPI
 
2
  from pydantic import BaseModel
3
  from transformers import pipeline
4
 
 
17
 
18
  @app.post("/classify")
19
  async def classify(payload: Payload):
20
+ return {"response": classify_text(payload.text)}
21
+