Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ embedding_model = CohereEmbedding(
|
|
34 |
embedding_type="int8",)
|
35 |
|
36 |
|
37 |
-
memory =
|
38 |
|
39 |
# Set Global settings
|
40 |
Settings.llm = llm
|
@@ -90,6 +90,7 @@ def create_col(documents):
|
|
90 |
|
91 |
def infer(message:str, history: list):
|
92 |
global db_path
|
|
|
93 |
option=""
|
94 |
print(f'message: {message}')
|
95 |
print(f'history: {history}')
|
@@ -100,6 +101,7 @@ def infer(message:str, history: list):
|
|
100 |
if files_list:
|
101 |
documents, option = extract_doc(files_list)
|
102 |
db_path = create_col(documents)
|
|
|
103 |
else:
|
104 |
if message["text"].startswith("http://") or message["text"].startswith("https://"):
|
105 |
documents, option = extract_web(message["text"])
|
|
|
34 |
embedding_type="int8",)
|
35 |
|
36 |
|
37 |
+
memory = ""
|
38 |
|
39 |
# Set Global settings
|
40 |
Settings.llm = llm
|
|
|
90 |
|
91 |
def infer(message:str, history: list):
|
92 |
global db_path
|
93 |
+
global memory
|
94 |
option=""
|
95 |
print(f'message: {message}')
|
96 |
print(f'history: {history}')
|
|
|
101 |
if files_list:
|
102 |
documents, option = extract_doc(files_list)
|
103 |
db_path = create_col(documents)
|
104 |
+
memory = ChatMemoryBuffer.from_defaults(token_limit=3900)
|
105 |
else:
|
106 |
if message["text"].startswith("http://") or message["text"].startswith("https://"):
|
107 |
documents, option = extract_web(message["text"])
|