Update main.py
Browse files
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"]}
|