sth4nth commited on
Commit
e799e02
1 Parent(s): d3f2872

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -0
main.py CHANGED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
4
+
5
+ @app.get("/infer_t5")
6
+ def t5(input):
7
+ output = pipe_flan(input)
8
+ return {"output": output[0]["generated_text"]}