tangminhanh commited on
Commit
5a33d2c
1 Parent(s): ebe0081

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+ from transformers import pipeline
5
+
6
+ pipe = pipeline("text-classification", model="kmcs-casulit/hr_cate")
7
+
8
+ @app.get("/")
9
+ def greet_json():
10
+ return {"message": "Hello, World!"}
11
+
12
+ @app.get("/")
13
+ def classify(text: str):
14
+ output = pipe(text)
15
+ return {"output": output[0]['label']}