binsan commited on
Commit
d9355ac
1 Parent(s): a9561be
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,7 +1,15 @@
1
  from fastapi import FastAPI
 
 
 
 
2
 
3
  app = FastAPI()
4
 
5
  @app.get("/")
6
  def greet_json():
7
- return {"Hello": "World!"}
 
 
 
 
 
1
  from fastapi import FastAPI
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline("zero-shot-classification")
5
+
6
 
7
  app = FastAPI()
8
 
9
  @app.get("/")
10
  def greet_json():
11
+ j = classifier(
12
+ "This is a course about the Transformers library",
13
+ candidate_labels=["education", "politics", "business"],
14
+ )
15
+ return {"Hello": str(j)}