Creating an APP using FASTAPI is also possible . Before doing so you may need to add the pip install
command to your project's app.sh
before it calls your Python script, or add the line to your environment’s Dockerfile.
Here is a sample on how to do so:
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
if __name__ == "__main__":
uvicorn.run("model:app",host="0.0.0.0",port=8888,reload = True)
Limitations
As with all apps in Domino, this is limited by the standard limitations that the app is presented in an iFrame, so adding paths to the end of your app’s URL (e.g. https://<url>/modelproducts/61b204aa792ec2588b97d60d/bar
) doesn't really work unless you work out https://<url>/$DOMINO_PROJECT_OWNER/$DOMINO_PROJECT_NAME/r/notebookSession/$DOMINO_RUN_ID
***See
Comments
0 comments
Please sign in to leave a comment.