complynx commited on
Commit
923fd0e
Β·
1 Parent(s): 47c1d0e

move run all at once

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -80,7 +80,7 @@ def bot(history, model_name, oepnai_api_key,
80
  # Retrieve documents relevant to query
81
  document_start = perf_counter()
82
 
83
- if reranker_enabled:
84
  documents = retrieve(query, int(num_docs), model_kind, sub_vector_size, chunk_size, splitter_type,reranker_kind,num_prerank_docs)
85
  else:
86
  documents = retrieve(query, int(num_docs), model_kind, sub_vector_size, chunk_size, splitter_type)
@@ -150,13 +150,13 @@ with gr.Blocks() as demo:
150
  sub_vector_size = gr.Radio(choices=sub_vectors, value="32", label="sub-vector size")
151
  chunk_size = gr.Radio(choices=chunk_sizes, value="2000", label="chunk size")
152
  splitter_type = gr.Radio(choices=splitters, value="nltk", label="splitter")
 
153
  with gr.Row():
154
  reranker_enabled = gr.Checkbox(value=False, label="Reranker enabled")
155
  reranker_kind = gr.Radio(choices=emb_models, value="bge", label="Reranker model")
156
  num_prerank_docs = gr.Slider(5, 80, label="Number of docs before reranker", step=1, value=20)
157
  with gr.Row():
158
  num_docs = gr.Slider(1, 20, label="number of docs", step=1, value=4)
159
- all_at_once = gr.Checkbox(value=False, label="Run all at once")
160
  model_name = gr.Radio(choices=inf_models, value=inf_models[0], label="Chat model")
161
  oepnai_api_key = gr.Textbox(
162
  show_label=False,
 
80
  # Retrieve documents relevant to query
81
  document_start = perf_counter()
82
 
83
+ if reranker_enabled and not all_at_once:
84
  documents = retrieve(query, int(num_docs), model_kind, sub_vector_size, chunk_size, splitter_type,reranker_kind,num_prerank_docs)
85
  else:
86
  documents = retrieve(query, int(num_docs), model_kind, sub_vector_size, chunk_size, splitter_type)
 
150
  sub_vector_size = gr.Radio(choices=sub_vectors, value="32", label="sub-vector size")
151
  chunk_size = gr.Radio(choices=chunk_sizes, value="2000", label="chunk size")
152
  splitter_type = gr.Radio(choices=splitters, value="nltk", label="splitter")
153
+ all_at_once = gr.Checkbox(value=False, label="Run all at once (no reranker)")
154
  with gr.Row():
155
  reranker_enabled = gr.Checkbox(value=False, label="Reranker enabled")
156
  reranker_kind = gr.Radio(choices=emb_models, value="bge", label="Reranker model")
157
  num_prerank_docs = gr.Slider(5, 80, label="Number of docs before reranker", step=1, value=20)
158
  with gr.Row():
159
  num_docs = gr.Slider(1, 20, label="number of docs", step=1, value=4)
 
160
  model_name = gr.Radio(choices=inf_models, value=inf_models[0], label="Chat model")
161
  oepnai_api_key = gr.Textbox(
162
  show_label=False,