Spaces:
Runtime error
Runtime error
change sockets path
Browse files- Dockerfile +1 -1
- app.py +7 -4
- templates/chat.html +2 -2
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 ["gunicorn", "-b", "0.0.0.0:7860", "-k", "eventlet", "app:app"]
|
|
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
COPY --chown=user . /app
|
16 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "-k", "eventlet", "--workers", "1", "app:app"]
|
app.py
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
-
import
|
|
|
|
|
|
|
2 |
from dotenv import load_dotenv
|
3 |
from flask import Flask, request, render_template
|
4 |
from flask_cors import CORS
|
5 |
-
from flask_socketio import SocketIO, emit
|
|
|
6 |
from langchain_core.output_parsers import StrOutputParser
|
7 |
-
from langchain_core.prompts import ChatPromptTemplate
|
8 |
from langchain_core.runnables import RunnablePassthrough
|
9 |
from langchain_huggingface.embeddings import HuggingFaceEmbeddings
|
10 |
from langchain.retrievers.document_compressors import EmbeddingsFilter
|
@@ -12,7 +16,6 @@ from langchain.retrievers import ContextualCompressionRetriever
|
|
12 |
from langchain.retrievers import EnsembleRetriever
|
13 |
from langchain_community.vectorstores import FAISS
|
14 |
from langchain_groq import ChatGroq
|
15 |
-
from langchain_community.document_compressors import JinaRerank
|
16 |
from langchain import hub
|
17 |
import pickle
|
18 |
import os
|
|
|
1 |
+
import eventlet
|
2 |
+
eventlet.monkey_patch()
|
3 |
+
|
4 |
+
|
5 |
from dotenv import load_dotenv
|
6 |
from flask import Flask, request, render_template
|
7 |
from flask_cors import CORS
|
8 |
+
from flask_socketio import SocketIO, emit
|
9 |
+
|
10 |
from langchain_core.output_parsers import StrOutputParser
|
11 |
+
from langchain_core.prompts import ChatPromptTemplate
|
12 |
from langchain_core.runnables import RunnablePassthrough
|
13 |
from langchain_huggingface.embeddings import HuggingFaceEmbeddings
|
14 |
from langchain.retrievers.document_compressors import EmbeddingsFilter
|
|
|
16 |
from langchain.retrievers import EnsembleRetriever
|
17 |
from langchain_community.vectorstores import FAISS
|
18 |
from langchain_groq import ChatGroq
|
|
|
19 |
from langchain import hub
|
20 |
import pickle
|
21 |
import os
|
templates/chat.html
CHANGED
@@ -410,7 +410,7 @@
|
|
410 |
<script>
|
411 |
|
412 |
// Initialize Socket.IO client
|
413 |
-
var socket = io.connect('
|
414 |
transports: ['websocket']
|
415 |
});
|
416 |
|
@@ -582,7 +582,7 @@
|
|
582 |
console.warn("Disconnected from server:", reason);
|
583 |
response = "";
|
584 |
// appendAnswer("You have been disconnected from the server. Please refresh the page to reconnect.");
|
585 |
-
socket = io.connect('
|
586 |
transports: ['websocket']
|
587 |
});
|
588 |
});
|
|
|
410 |
<script>
|
411 |
|
412 |
// Initialize Socket.IO client
|
413 |
+
var socket = io.connect('https://ritesh-hf-adafsa-flask-app-demo.hf.space', {
|
414 |
transports: ['websocket']
|
415 |
});
|
416 |
|
|
|
582 |
console.warn("Disconnected from server:", reason);
|
583 |
response = "";
|
584 |
// appendAnswer("You have been disconnected from the server. Please refresh the page to reconnect.");
|
585 |
+
socket = io.connect('https://ritesh-hf-adafsa-flask-app-demo.hf.space', {
|
586 |
transports: ['websocket']
|
587 |
});
|
588 |
});
|