devve1 commited on
Commit
b1422f4
1 Parent(s): 90d7d9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 not st.session_state.documents_only:
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: