Skip to content

Commit

Permalink
Fixes #1685
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudotensor committed Jun 14, 2024
1 parent 7340826 commit 3f58988
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 9 additions & 0 deletions src/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ def main(
visible_visible_models: bool = True,
visible_submit_buttons: bool = True,
visible_side_bar: bool = True,
visible_document_subset: bool = True,
visible_max_quality: bool = True,
visible_add_doc_to_chat: bool = True,
visible_chat_history: bool = True,
visible_doc_track: bool = True,

visible_chat_tab: bool = True,
Expand Down Expand Up @@ -994,7 +998,12 @@ def main(
:param visible_visible_models: Whether visible models drop-down is visible in UI
:param visible_submit_buttons: whether submit buttons are visible when UI first comes up
:param visible_side_bar: whether left side bar is visible when UI first comes up
:param visible_document_subset: whether document subset is visible when UI first comes up
:param visible_max_quality: whether max quality is visible when UI first comes up
:param visible_add_doc_to_chat: whether add document to chat is visible when UI first comes up
:param visible_chat_history: whether chat history being choosable is visible when UI first comes up
:param visible_doc_track: whether left side bar's document tracking is visible when UI first comes up
:param visible_chat_tab: "" for chat tab
:param visible_doc_selection_tab: "" for doc selection tab
:param visible_doc_view_tab: "" for doc view tab
Expand Down
14 changes: 8 additions & 6 deletions src/gradio_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,10 @@ def get_df_langchain_mode_paths(selection_docs_state1, db1s, dbs1=None):
)
if kwargs['actions_in_sidebar']:
max_quality = gr.Checkbox(label="Max Ingest Quality", value=kwargs['max_quality'],
visible=not is_public)
visible=kwargs['visible_max_quality'] and not is_public)
gradio_upload_to_chatbot = gr.Checkbox(label="Add Doc to Chat",
value=kwargs['gradio_upload_to_chatbot'],
visible=not is_public)
visible=kwargs['visible_add_doc_to_chat'] and not is_public)
url_text = gr.Textbox(label=url_label,
# placeholder="Enter Submits",
max_lines=1,
Expand All @@ -1000,14 +1000,16 @@ def get_df_langchain_mode_paths(selection_docs_state1, db1s, dbs1=None):
if not kwargs['actions_in_sidebar']:
max_quality = gr.Checkbox(label="Max Ingest Quality",
value=kwargs['max_quality'],
visible=not is_public)
visible=kwargs['visible_max_quality'] and not is_public)
gradio_upload_to_chatbot = gr.Checkbox(label="Add Doc to Chat",
value=kwargs['gradio_upload_to_chatbot'])
value=kwargs['gradio_upload_to_chatbot'],
visible=kwargs['visible_add_doc_to_chat'])

if not kwargs['actions_in_sidebar']:
add_chat_history_to_context = gr.Checkbox(label="Include Chat History",
value=kwargs[
'add_chat_history_to_context'])
'add_chat_history_to_context'],
visible=kwargs['visible_chat_history'])
add_search_to_context = gr.Checkbox(label="Include Web Search",
value=kwargs['add_search_to_context'],
visible=serp_visible)
Expand All @@ -1034,7 +1036,7 @@ def get_df_langchain_mode_paths(selection_docs_state1, db1s, dbs1=None):
label="Subset",
value=DocumentSubset.Relevant.name,
interactive=True,
visible=not is_public,
visible=kwargs['visible_document_subset'] and not is_public,
)
if kwargs['actions_in_sidebar']:
langchain_action = gr.Radio(
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7c703cbc281ef9ef384406334c244be83273a91d"
__version__ = "7340826e7635435331e6e3d3ad19b27122db3462"

0 comments on commit 3f58988

Please sign in to comment.