Spaces:
Runtime error
Runtime error
Download app/server.py from RJuro/cheese-doc: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/RJuro/cheese-doc/resolve/main/app/server.py
- Command line
-
hf download hf://spaces/RJuro/cheese-doc/app/server.py
-
curl -L -o server.py https://huggingface.co/spaces/RJuro/cheese-doc/resolve/main/app/server.py
535 Bytes
| from fastapi import FastAPI | |
| from fastapi.responses import RedirectResponse | |
| from langserve import add_routes | |
| from pirate_speak.chain import chain as pirate_speak_chain | |
| app = FastAPI() | |
| async def redirect_root_to_docs(): | |
| return RedirectResponse("/docs") | |
| # Edit this to add the chain you want to add | |
| add_routes(app, | |
| pirate_speak_chain, | |
| path="/pirate-speak", | |
| playground_type='chat') | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=8000) | |