Spaces:
Runtime error
Runtime error
Update app.py
Browse files123456789101112131410 unmodified lines2526272829from fastapi import FastAPIfrom transformers import pipelinefrom huggingface_hub import login## create a new FASTAPI app instanceapp=FastAPI()# Initialize the text generation pipelinepipe = pipeline("text-generation", model="google/flan-t5-small")@app.get("/")10 unmodified lines## return the generate text in Json reposnereturn {"output":output[0]['generated_text']}123456789101110 unmodified lines222324from fastapi import FastAPIfrom transformers import pipeline## create a new FASTAPI app instanceapp=FastAPI()# Initialize the text generation pipelinepipe = pipeline("text2text-generation", model="google/flan-t5-small")@app.get("/")10 unmodified lines## return the generate text in Json reposnereturn {"output":output[0]['generated_text']}
app.py+1-6