Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
from transformers import pipeline | |
app = FastAPI() | |
pipe = pipeline("text-generation", model="google/flan-t5-small") | |
async def generate_text(text:str): | |
output = pipe(text) | |
return {"output": output} | |
async def root(): | |
return {"message": "Welcome to the LLM API!"} | |