From 1f63c415b4d35d1940321214924e54e4bdfdd1f2 Mon Sep 17 00:00:00 2001 From: Ilya Matiach Date: Thu, 27 Jun 2024 17:40:29 -0400 Subject: [PATCH] Fix responsibleai toolbox build failures due to dependency updates --- ...ksgenre-binary-text-classification-model-debugging.ipynb | 2 +- ...idashboard-fridge-object-detection-model-debugging.ipynb | 4 ++-- .../datasets/vision/object_detection_data_utils.py | 4 ++-- raiwidgets/raiwidgets/fairness_dashboard.py | 6 +++--- responsibleai_text/tests/common_text_utils.py | 1 + responsibleai_vision/tests/common_vision_utils.py | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/notebooks/responsibleaidashboard/text/responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.ipynb b/notebooks/responsibleaidashboard/text/responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.ipynb index 1696ca2b0c..bb46d0591e 100644 --- a/notebooks/responsibleaidashboard/text/responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.ipynb +++ b/notebooks/responsibleaidashboard/text/responsibleaidashboard-blbooksgenre-binary-text-classification-model-debugging.ipynb @@ -100,7 +100,7 @@ "\n", "def load_dataset(split):\n", " config_kwargs = {\"name\": \"title_genre_classifiction\"}\n", - " dataset = datasets.load_dataset(\"blbooksgenre\", split=split, **config_kwargs)\n", + " dataset = datasets.load_dataset(\"blbooksgenre\", split=split, trust_remote_code=True, **config_kwargs)\n", " return pd.DataFrame({\"text\": dataset[\"title\"], \"label\": dataset[\"label\"]})\n", "\n", "pd_data = load_dataset(\"train\")\n", diff --git a/notebooks/responsibleaidashboard/vision/responsibleaidashboard-fridge-object-detection-model-debugging.ipynb b/notebooks/responsibleaidashboard/vision/responsibleaidashboard-fridge-object-detection-model-debugging.ipynb index 3b682544bf..6817ae269c 100644 --- a/notebooks/responsibleaidashboard/vision/responsibleaidashboard-fridge-object-detection-model-debugging.ipynb +++ b/notebooks/responsibleaidashboard/vision/responsibleaidashboard-fridge-object-detection-model-debugging.ipynb @@ -115,8 +115,8 @@ " os.makedirs(\"data\", exist_ok=True)\n", "\n", " # download data\n", - " download_url = (\"https://cvbp-secondary.z19.web.core.windows.net/\" +\n", - " \"datasets/object_detection/odFridgeObjects.zip\")\n", + " download_url = (\"https://publictestdatasets.blob.core.windows.net/\" +\n", + " \"computervision/odFridgeObjects.zip\")\n", " data_file = \"./odFridgeObjects.zip\"\n", " urlretrieve(download_url, filename=data_file)\n", "\n", diff --git a/rai_test_utils/rai_test_utils/datasets/vision/object_detection_data_utils.py b/rai_test_utils/rai_test_utils/datasets/vision/object_detection_data_utils.py index aab731f743..b296e8c1e7 100644 --- a/rai_test_utils/rai_test_utils/datasets/vision/object_detection_data_utils.py +++ b/rai_test_utils/rai_test_utils/datasets/vision/object_detection_data_utils.py @@ -188,8 +188,8 @@ def load_fridge_object_detection_dataset(): os.makedirs("data", exist_ok=True) # download data - download_url = ("https://cvbp-secondary.z19.web.core.windows.net/" + - "datasets/object_detection/odFridgeObjects.zip") + download_url = ("https://publictestdatasets.blob.core.windows.net/" + + "computervision/odFridgeObjects.zip") data_file = "./odFridgeObjects.zip" request_file.urlretrieve(download_url, filename=data_file) diff --git a/raiwidgets/raiwidgets/fairness_dashboard.py b/raiwidgets/raiwidgets/fairness_dashboard.py index d6272f3630..bc32edaf4c 100644 --- a/raiwidgets/raiwidgets/fairness_dashboard.py +++ b/raiwidgets/raiwidgets/fairness_dashboard.py @@ -149,6 +149,8 @@ def metrics(): ][0].values()), }} if error_function_name in metric_method: + group_by_error = metric_frame.by_group[error_function_name] + bounds_list = list(group_by_error.to_dict().values()) result["data"].update({ "bounds": { "lower": @@ -161,9 +163,7 @@ def metrics(): "lower": bounds[0], "upper": bounds[1] } - for bounds in list( - metric_frame.by_group[error_function_name]\ - .to_dict().values())] + for bounds in bounds_list] }) return jsonify(result) except Exception as ex: diff --git a/responsibleai_text/tests/common_text_utils.py b/responsibleai_text/tests/common_text_utils.py index 6b29c60a50..90d46b09da 100644 --- a/responsibleai_text/tests/common_text_utils.py +++ b/responsibleai_text/tests/common_text_utils.py @@ -112,6 +112,7 @@ def load_covid19_emergency_event_dataset(with_metadata=False): def load_blbooks_genre_dataset(): config_kwargs = {"name": "annotated_raw"} dataset = datasets.load_dataset("blbooksgenre", split="train", + trust_remote_code=True, **config_kwargs) grouping_col = 'BL record ID' columns = {"text": dataset["Title"], diff --git a/responsibleai_vision/tests/common_vision_utils.py b/responsibleai_vision/tests/common_vision_utils.py index 63239c5b7a..b3f63c6bd0 100644 --- a/responsibleai_vision/tests/common_vision_utils.py +++ b/responsibleai_vision/tests/common_vision_utils.py @@ -293,8 +293,8 @@ def load_fridge_object_detection_dataset(automl_format=False): os.makedirs("data", exist_ok=True) # download data - download_url = ("https://cvbp-secondary.z19.web.core.windows.net/" + - "datasets/object_detection/odFridgeObjects.zip") + download_url = ("https://publictestdatasets.blob.core.windows.net/" + + "computervision/odFridgeObjects.zip") data_file = "./odFridgeObjects.zip" retrieve_unzip_file(download_url, data_file)