Spaces:
Paused
Paused
| from fastapi import FastAPI | |
| from transformers import pipeline | |
| app = FastAPI() | |
| #pipe = pipeline("text2text-generation", model="google/flan-t5-small") | |
| pipe = pipeline("text2text-generation", model="google/flan-t5-large", max_new_tokens=1000) | |
| def home(): | |
| return {"Hello World!"} | |
| def generate(prompt:str): | |
| output = pipe(prompt) | |
| return {"output":output[0]['generated_text']} |