Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,12 +70,10 @@ class StopOnTokens(StoppingCriteria):
|
|
| 70 |
|
| 71 |
def predict(message, history):
|
| 72 |
|
|
|
|
| 73 |
#For now, we only query the vector database once, at the start.
|
| 74 |
if len(history) == 0:
|
| 75 |
source_text = vector_search(message)
|
| 76 |
-
else:
|
| 77 |
-
source_text = re.sub("^.+?\n\n### Source ###\n", "", history[0][0])
|
| 78 |
-
print(source_text)
|
| 79 |
|
| 80 |
history_transformer_format = history + [[message, ""]]
|
| 81 |
|
|
|
|
| 70 |
|
| 71 |
def predict(message, history):
|
| 72 |
|
| 73 |
+
global source_text
|
| 74 |
#For now, we only query the vector database once, at the start.
|
| 75 |
if len(history) == 0:
|
| 76 |
source_text = vector_search(message)
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
history_transformer_format = history + [[message, ""]]
|
| 79 |
|