Spaces:
Runtime error
Runtime error
Annikaijak
commited on
Commit
•
db09ba7
1
Parent(s):
125aa84
Upload 4 files
Browse files- app/__init__.py +0 -0
- app/__pycache__/__init__.cpython-311.pyc +0 -0
- app/__pycache__/server.cpython-311.pyc +0 -0
- app/server.py +23 -0
app/__init__.py
ADDED
File without changes
|
app/__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (224 Bytes). View file
|
|
app/__pycache__/server.cpython-311.pyc
ADDED
Binary file (1.01 kB). View file
|
|
app/server.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from fastapi.responses import RedirectResponse
|
3 |
+
from langserve import add_routes
|
4 |
+
from pirate_speak.chain import chain as pirate_speak_chain
|
5 |
+
|
6 |
+
app = FastAPI()
|
7 |
+
|
8 |
+
|
9 |
+
@app.get("/")
|
10 |
+
async def redirect_root_to_docs():
|
11 |
+
return RedirectResponse("/docs")
|
12 |
+
|
13 |
+
|
14 |
+
# Edit this to add the chain you want to add
|
15 |
+
add_routes(app,
|
16 |
+
pirate_speak_chain,
|
17 |
+
path="/pirate-speak",
|
18 |
+
playground_type='chat')
|
19 |
+
|
20 |
+
if __name__ == "__main__":
|
21 |
+
import uvicorn
|
22 |
+
|
23 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|