Robin commited on
Commit
96d2860
·
1 Parent(s): 229aef1

variable fix

Browse files
Files changed (4) hide show
  1. Dockerfile +1 -1
  2. app.py +2 -2
  3. requirements.txt +3 -1
  4. 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 ["mistralai", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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("/api/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(messages=message.messages)
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('/api/generate-text', {
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'