Mohamed-Sami commited on
Commit
f07b276
·
verified ·
1 Parent(s): 8326741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -1,21 +1,22 @@
1
- from transformers import pipeline
2
- from fastapi import FastAPI
3
-
4
- app = FastAPI()
5
-
6
- pipe = pipeline("text2text-generation", model="google/flan-t5-small")
7
-
8
- @app.get("/")
9
- def home():
10
- return "hello world"
11
-
12
-
13
- @app.get("/generate")
14
- def generate(text:str):
15
-
16
- res = pipe(text)
17
-
18
- return {"output":res[0]['generated_text']}
19
-
20
-
21
-
 
 
1
+ from transformers import pipeline
2
+ from fastapi import FastAPI
3
+
4
+ app = FastAPI()
5
+
6
+ pipe = pipeline("text2text-generation", model="google/flan-t5-small")
7
+
8
+ @app.get("/")
9
+ def home():
10
+ return "hello world"
11
+
12
+
13
+ @app.get("/generate")
14
+ def generate(text:str):
15
+
16
+ res = pipe(text)
17
+
18
+
19
+ return {"output":res[0]['generated_text']}
20
+
21
+
22
+