Spaces:
Paused
Paused
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| import uvicorn | |
| app = FastAPI() | |
| class Item(BaseModel): | |
| claim: str | |
| source: str | |
| def greet_json(): | |
| return {"Hello": "World!"} | |
| def generate(item: Item): | |
| # return "Claim: " + item['claim'] # python | |
| return "Claim: " + item.claim # huggingface space | |
| async def generate_text(item: Item): | |
| return {"response": generate(item)} | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |