From e9127e8c89bc1ff144a046e58c631b81a9eb32f5 Mon Sep 17 00:00:00 2001 From: almaz Date: Tue, 3 Dec 2024 13:09:15 +0100 Subject: [PATCH] get nested datasets --- src/main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 074532f..a23c01e 100644 --- a/src/main.py +++ b/src/main.py @@ -24,6 +24,7 @@ Field, Progress, SelectDataset, + SelectDatasetTree, NotificationBox, ) @@ -72,7 +73,7 @@ def update_globals(new_dataset_ids): ### Dataset selection -dataset_selector = SelectDataset(project_id=project_id, multiselect=True, select_all_datasets=True) +dataset_selector = SelectDatasetTree(project_id=project_id, multiselect=True, select_all_datasets=True) card_project_settings = Card(title="Dataset selection", content=dataset_selector) ### Model selection @@ -281,6 +282,14 @@ def update_table(): @btn_run.click def run(): global model_name, global_idxs_mapping, all_info_list # , project_meta, dataset_ids, project_id, workspace_id, team_id + + selected_datasets = set() + for dataset_id in dataset_selector.get_selected_ids(): + selected_datasets.add(dataset_id) + for ds in api.dataset.get_nested(project_id=project_id, dataset_id=dataset_id): + selected_datasets.add(ds.id) + update_globals(list(selected_datasets)) + info_run.description = "" card_embeddings_chart.hide() btn_mark.hide()