SumanSaurav commited on
Commit
29a9cc0
·
verified ·
1 Parent(s): 5b01b6c

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +0 -0
  2. app.py +19 -0
  3. requirements.txt +0 -0
Dockerfile ADDED
File without changes
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from transformers import pipeline
3
+
4
+ app = FastAPI()
5
+
6
+
7
+ pipe = pipeline("text2text-generation", model="google/flan-t5-small")
8
+
9
+ @app.get("/")
10
+ def home():
11
+ return{
12
+ "message":"Hello world"
13
+ }
14
+
15
+ @app.get("/generate")
16
+ def generate(text:str):
17
+ output=pipe(text)
18
+
19
+ return {"output":output[0]['genetated_text']}
requirements.txt ADDED
File without changes