Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
sth4nth
/
sdk1
like
0
Sleeping
App
Files
Files
Community
e799e02
sdk1
/
main.py
sth4nth
Update main.py
e799e02
verified
4 months ago
raw
Copy download link
history
blame
No virus
228 Bytes
from
transformers
import
pipeline
pipe_flan = pipeline(
"text2text-generation"
, model=
"google/flan-t5-small"
)
@app.get(
"/infer_t5"
)
def
t5
(
input
):
output = pipe_flan(
input
)
return
{
"output"
: output[
0
][
"generated_text"
]}