Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,8 +61,7 @@ def get_index(index_file_path):
|
|
| 61 |
print_header_json_file(index_file_path)
|
| 62 |
index_size = os.path.getsize(index_file_path)
|
| 63 |
print(f"Size of {index_file_path}: {index_size} bytes") #let me know how big json file is.
|
| 64 |
-
|
| 65 |
-
|
| 66 |
loaded_index = GPTSimpleVectorIndex.load_from_disk(index_file_path)
|
| 67 |
return loaded_index
|
| 68 |
else:
|
|
@@ -80,7 +79,7 @@ index = get_index(INDEX_FILE)
|
|
| 80 |
# passes the prompt to the chatbot
|
| 81 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 82 |
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."
|
| 83 |
-
response = index.query(prompt, response_mode="
|
| 84 |
|
| 85 |
store_message(input_text,response)
|
| 86 |
|
|
|
|
| 61 |
print_header_json_file(index_file_path)
|
| 62 |
index_size = os.path.getsize(index_file_path)
|
| 63 |
print(f"Size of {index_file_path}: {index_size} bytes") #let me know how big json file is.
|
| 64 |
+
|
|
|
|
| 65 |
loaded_index = GPTSimpleVectorIndex.load_from_disk(index_file_path)
|
| 66 |
return loaded_index
|
| 67 |
else:
|
|
|
|
| 79 |
# passes the prompt to the chatbot
|
| 80 |
def chatbot(input_text, mentioned_person='Mediator John Haynes', confidence_threshold=0.5):
|
| 81 |
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."
|
| 82 |
+
response = index.query(prompt, response_mode="default", verbose=True)
|
| 83 |
|
| 84 |
store_message(input_text,response)
|
| 85 |
|