Update utils.py
Browse files
utils.py
CHANGED
@@ -108,7 +108,7 @@ def num_tokens_from_string(string: str, encoding_name: str) -> int:
|
|
108 |
def chat(
|
109 |
query: str,
|
110 |
history: list,
|
111 |
-
query_mode : str,
|
112 |
threshold: float = CFG_APP.THRESHOLD,
|
113 |
k_total: int = CFG_APP.K_TOTAL,
|
114 |
) -> tuple:
|
@@ -157,7 +157,7 @@ def chat(
|
|
157 |
|
158 |
messages = history + [{"role": "user", "content": query}]
|
159 |
|
160 |
-
if query_mode == 'HYDE' :
|
161 |
reformulated_query = reformulated_query.split("?")[0] + '?'
|
162 |
|
163 |
docs_url = defaultdict(str)
|
|
|
108 |
def chat(
|
109 |
query: str,
|
110 |
history: list,
|
111 |
+
query_mode : str = 'HYDE',
|
112 |
threshold: float = CFG_APP.THRESHOLD,
|
113 |
k_total: int = CFG_APP.K_TOTAL,
|
114 |
) -> tuple:
|
|
|
157 |
|
158 |
messages = history + [{"role": "user", "content": query}]
|
159 |
|
160 |
+
if query_mode is None or query_mode == 'HYDE' :
|
161 |
reformulated_query = reformulated_query.split("?")[0] + '?'
|
162 |
|
163 |
docs_url = defaultdict(str)
|