Spaces:
Sleeping
Sleeping
# https://medium.com/@qacheampong/building-and-deploying-a-fastapi-app-with-hugging-face-9210e9b4a713 | |
# https://huggingface.co/spaces/Queensly/FastAPI_in_Docker | |
from fastapi import FastAPI,Request | |
import uvicorn | |
app = FastAPI() | |
#Endpoints | |
#Root endpoints | |
def root(): | |
return {"API": "Sum of 2 Squares"} | |
def predict(request: Request): | |
prompt = request.json.get('prompt') | |
return "你好啊"+prompt | |