Spaces:
Runtime error
Runtime error
| from fastapi import FastAPI | |
| app = FastAPI() | |
| async def root(): | |
| return {"message": "Hello World"} | |
| def generate(text:str): | |
| ## use the pipeline to generate text from given input text | |
| output=pipe(text) | |
| ## return the generate text in Json reposne | |
| return {"output":output[0]['generated_text']} |