Skip to content

Commit

Permalink
fix: Remove Collections from all index names (#473)
Browse files Browse the repository at this point in the history
Co-authored-by: Tadashi <[email protected]>
  • Loading branch information
pvl and taprosoft authored Dec 4, 2024
1 parent 32732c3 commit 159f4da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions flowsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@

GRAPHRAG_INDICES = [
{
"name": graph_type.split(".")[-1].replace("Index", ""), # get last name
"name": graph_type.split(".")[-1].replace("Index", "")
+ " Collection", # get last name
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
Expand All @@ -318,7 +319,7 @@

KH_INDICES = [
{
"name": "File",
"name": "File Collection",
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
Expand Down
2 changes: 1 addition & 1 deletion libs/ktem/ktem/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def ui(self):
) as self._tabs["indices-tab"]:
for index in self.index_manager.indices:
with gr.Tab(
f"{index.name} Collection",
index.name,
elem_id=f"{index.id}-tab",
) as self._tabs[f"{index.id}-tab"]:
page = index.get_index_page_ui()
Expand Down
4 changes: 1 addition & 3 deletions libs/ktem/ktem/pages/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def on_building_ui(self):
continue

index_ui.unrender() # need to rerender later within Accordion
with gr.Accordion(
label=f"{index.name} Collection", open=index_id < 1
):
with gr.Accordion(label=index.name, open=index_id < 1):
index_ui.render()
gr_index = index_ui.as_gradio_component()

Expand Down
2 changes: 1 addition & 1 deletion libs/ktem/ktem/pages/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def index_tab(self):
id2name = {k: v.name for k, v in self._app.index_manager.info().items()}
with gr.Tab("Retrieval settings", visible=self._render_index_tab):
for pn, sig in self._default_settings.index.options.items():
name = "{} Collection".format(id2name.get(pn, f"<id {pn}>"))
name = id2name.get(pn, f"<id {pn}>")
with gr.Tab(name):
for n, si in sig.settings.items():
obj = render_setting_item(si, si.value)
Expand Down

0 comments on commit 159f4da

Please sign in to comment.