hf-mcp-server / app.py
petergits
Committing changes to main.py that works locally.
09c909e
raw
history blame contribute delete
339 Bytes
from fastapi import FastAPI
from transformers import pipeline
app = FastAPI()
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
@app.get("/")
def greet_json():
return {"Hello": "World!"}
@app.get("/infer_t5")
def t5(input):
output = pipe_flan(input)
return {"output": output[0]["generated_text"]}