Spaces:
Running
Running
Robin
commited on
Commit
·
96d2860
1
Parent(s):
229aef1
variable fix
Browse files- Dockerfile +1 -1
- app.py +2 -2
- requirements.txt +3 -1
- static/index.html +1 -1
Dockerfile
CHANGED
@@ -13,4 +13,4 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
COPY --chown=user . /app
|
16 |
-
CMD ["
|
|
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
COPY --chown=user . /app
|
16 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -60,11 +60,11 @@ def generate_text(message: Message):
|
|
60 |
"chat_history": chat_history
|
61 |
}
|
62 |
|
63 |
-
@app.post("/
|
64 |
def inference(message: Message, request: Request):
|
65 |
if request.headers.get("origin") != "https://Mistral-AI-Game-Jam/team13.static.hf.space":
|
66 |
return 204
|
67 |
-
return generate_text(
|
68 |
|
69 |
|
70 |
@app.get("/chat-history", tags=["History"])
|
|
|
60 |
"chat_history": chat_history
|
61 |
}
|
62 |
|
63 |
+
@app.post("/generate-text")
|
64 |
def inference(message: Message, request: Request):
|
65 |
if request.headers.get("origin") != "https://Mistral-AI-Game-Jam/team13.static.hf.space":
|
66 |
return 204
|
67 |
+
return generate_text(message=message)
|
68 |
|
69 |
|
70 |
@app.get("/chat-history", tags=["History"])
|
requirements.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
fastapi
|
2 |
-
mistralai
|
3 |
uvicorn[standard]
|
|
|
|
|
|
|
|
1 |
fastapi
|
|
|
2 |
uvicorn[standard]
|
3 |
+
mistralai
|
4 |
+
python-dotenv
|
5 |
+
pydantic
|
static/index.html
CHANGED
@@ -69,7 +69,7 @@
|
|
69 |
messageInput.value = '';
|
70 |
|
71 |
// Send to API
|
72 |
-
fetch('/
|
73 |
method: 'POST',
|
74 |
headers: {
|
75 |
'Content-Type': 'application/json'
|
|
|
69 |
messageInput.value = '';
|
70 |
|
71 |
// Send to API
|
72 |
+
fetch('/generate-text', {
|
73 |
method: 'POST',
|
74 |
headers: {
|
75 |
'Content-Type': 'application/json'
|