Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ def store_message(chatinput: str, chatresponse: str):
|
|
| 57 |
|
| 58 |
return generate_text()
|
| 59 |
|
| 60 |
-
#gets the index file which is the context data
|
| 61 |
def get_index(index_file_path):
|
| 62 |
if os.path.exists(index_file_path):
|
| 63 |
index_size = os.path.getsize(index_file_path)
|
|
@@ -74,7 +74,7 @@ index = get_index(INDEX_FILE)
|
|
| 74 |
|
| 75 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 76 |
prompt = f"You are {mentioned_person}. Answer this: {input_text}. Reply from the contextual data or say you don't know. To finish, ask an insightful question."
|
| 77 |
-
response = index.query(prompt, response_mode="default")
|
| 78 |
|
| 79 |
store_message(input_text,response)
|
| 80 |
|
|
|
|
| 57 |
|
| 58 |
return generate_text()
|
| 59 |
|
| 60 |
+
#gets the precompiled index file which is the context data compiled into a vector index
|
| 61 |
def get_index(index_file_path):
|
| 62 |
if os.path.exists(index_file_path):
|
| 63 |
index_size = os.path.getsize(index_file_path)
|
|
|
|
| 74 |
|
| 75 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 76 |
prompt = f"You are {mentioned_person}. Answer this: {input_text}. Reply from the contextual data or say you don't know. To finish, ask an insightful question."
|
| 77 |
+
response = index.query(prompt, response_mode="default", verbose=True)
|
| 78 |
|
| 79 |
store_message(input_text,response)
|
| 80 |
|