Spaces:
Sleeping
Sleeping
Download app.py from Manav2512/text2textwithdocker: direct link, hf CLI and curl.
- Browser
- Download file 353 Bytes
-
https://huggingface.co/spaces/Manav2512/text2textwithdocker/resolve/main/app.py
- Command line
-
hf download hf://spaces/Manav2512/text2textwithdocker/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Manav2512/text2textwithdocker/resolve/main/app.py
353 Bytes
| from fastapi import FastAPI | |
| from transformers import pipeline | |
| app = FastAPI() | |
| pipe = pipeline("text2text-generation", model="MBZUAI/LaMini-T5-738M") | |
| def home(): | |
| return {"message":"Hello World"} | |
| def genrate(text:str): | |
| output = pipe(text) | |
| return {"output": output[0]['generated_text']} |