Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -263,7 +263,7 @@ def main(query: str, client: QdrantClient, collection_name: str, llm, dense_mode
|
|
263 |
answer = json.loads(gen_text(prompt, max_tokens=300, sampling_params=SamplingParams(temperature=0)))['answer']
|
264 |
answer = f"{answer}\n\n\nSource(s) :\n\n{result_metadatas}"
|
265 |
|
266 |
-
if
|
267 |
answer = f'Documents Based :\n\n{answer}'
|
268 |
else:
|
269 |
gen_choice = outlines.generate.choice(llm, choices=['Domain-Specific Question', 'General Question'])
|
@@ -275,7 +275,7 @@ def main(query: str, client: QdrantClient, collection_name: str, llm, dense_mode
|
|
275 |
answer = json.loads(gen_text(prompt, max_tokens=300, sampling_params=SamplingParams(temperature=0.6, top_p=0.9, top_k=10)))['answer']
|
276 |
else:
|
277 |
print(f'GLOBAL STATE : {global_state_documents_only}')
|
278 |
-
if global_state_documents_only:
|
279 |
prompt = idk(query)
|
280 |
answer = json.loads(gen_text(prompt, max_tokens=128, sampling_params=SamplingParams(temperature=0.6, top_p=0.9, top_k=10)))['answer']
|
281 |
else:
|
|
|
263 |
answer = json.loads(gen_text(prompt, max_tokens=300, sampling_params=SamplingParams(temperature=0)))['answer']
|
264 |
answer = f"{answer}\n\n\nSource(s) :\n\n{result_metadatas}"
|
265 |
|
266 |
+
if global_state_documents_only == False:
|
267 |
answer = f'Documents Based :\n\n{answer}'
|
268 |
else:
|
269 |
gen_choice = outlines.generate.choice(llm, choices=['Domain-Specific Question', 'General Question'])
|
|
|
275 |
answer = json.loads(gen_text(prompt, max_tokens=300, sampling_params=SamplingParams(temperature=0.6, top_p=0.9, top_k=10)))['answer']
|
276 |
else:
|
277 |
print(f'GLOBAL STATE : {global_state_documents_only}')
|
278 |
+
if global_state_documents_only == True:
|
279 |
prompt = idk(query)
|
280 |
answer = json.loads(gen_text(prompt, max_tokens=128, sampling_params=SamplingParams(temperature=0.6, top_p=0.9, top_k=10)))['answer']
|
281 |
else:
|