GemmaLLM / app.py
MohamedSaeed-dev's picture
Upload app.py
39df819 verified
raw
history blame contribute delete
358 Bytes
from fastapi import FastAPI
from transformers import pipeline
app = FastAPI()
pipe = pipeline("text-generation", model="google/flan-t5-small")
@app.post("/generate")
async def generate_text(text:str):
output = pipe(text)
return {"output": output}
@app.get("/")
async def root():
return {"message": "Welcome to the LLM API!"}