imanoop7 commited on
Commit
0f32f81
1 Parent(s): 8d43dc8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -1,20 +1,20 @@
1
- from transformers import pipeline# Use a pipeline as a high-level helper
2
- from fastapi import FastAPI
3
-
4
-
5
-
6
- app = FastAPI()
7
-
8
- #hugging-face pipline
9
- pipe = pipeline("text2text-generation", model="google/flan-t5-small")
10
-
11
- @app.get("/")
12
- def home():
13
- return {"message":"Hello World"}
14
-
15
- @app.get("generate")
16
- def generate(text:str):
17
- output = pipe(text)
18
-
19
- return {"output":output[0]['generated_text']}
20
-
 
1
+ from transformers import pipeline# Use a pipeline as a high-level helper
2
+ from fastapi import FastAPI
3
+
4
+
5
+
6
+ app = FastAPI()
7
+
8
+ pipe = pipeline("text2text-generation", model="google/flan-t5-small")
9
+
10
+ @app.get("/")
11
+ def home():
12
+ return {"message":"Hello World"}
13
+
14
+
15
+ @app.get("generate")
16
+ def generate(text:str):
17
+ output = pipe(text)
18
+
19
+ return {"output":output[0]['generated_text']}
20
+