Skip to content

Commit f2424be

Browse files
yoavkatzclaude
andauthored
fix: Compatibility with huggingface_hub 1.16, numpy 2.0, and pandas 3.0 (#1971)
* fix: Use namespaced HF dataset paths for huggingface_hub >= 1.16 compatibility huggingface_hub 1.16+ enforces that dataset repository IDs must use the 'namespace/name' format. Bare dataset names (e.g., 'hellaswag') are no longer accepted, causing HfUriError in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> * fix: Regenerate catalog JSONs with namespaced HF dataset paths Run all prepare/cards scripts to update the catalog JSON files with the full namespace/name format for HuggingFace dataset paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> * fix: Replace evaluate library with direct sklearn calls in F1MultiLabel The evaluate library's cached f1.py uses `float(score)` on numpy arrays, which raises TypeError with numpy >= 2.0. Bypass the evaluate wrapper and call sklearn's f1_score/precision_score/recall_score directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> * fix: Numpy 2.0 and pandas 3.0 compatibility fixes - F1 metric: replace evaluate library wrapper with direct sklearn calls to avoid numpy 2.0 float() TypeError on 0-d arrays - text2sql: cast DataFrame to str before sorting to avoid pandas 3.0 TypeError when assigning string values to int64 columns - wiki_bio: use namespaced HF dataset path (michaelauli/wiki_bio) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> * fix: Regenerate wiki_bio catalog JSON with namespaced HF path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> * fix: Use namespaced HF path for winogrande (allenai/winogrande) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yoav Katz <katz@il.ibm.com> --------- Signed-off-by: Yoav Katz <katz@il.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4497127 commit f2424be

91 files changed

Lines changed: 144 additions & 123 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

prepare/cards/arc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
for subtask in subtasks:
99
card = TaskCard(
10-
loader=LoadHF(path="ai2_arc", name=subtask),
10+
loader=LoadHF(path="allenai/ai2_arc", name=subtask),
1111
preprocess_steps=[
1212
Set({"topic": "science"}),
1313
Rename(field_to_field={"answerKey": "label", "choices": "_choices"}),

prepare/cards/billsum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
n_chars_to_filter_by_list = ["max", 6000, 10000]
1111
for n_chars_to_filter_by in n_chars_to_filter_by_list:
1212
card = TaskCard(
13-
loader=LoadHF(path="billsum"),
13+
loader=LoadHF(path="FiscalNote/billsum"),
1414
preprocess_steps=[
1515
SplitRandomMix(
1616
{"train": "train[87.5%]", "validation": "train[12.5%]", "test": "test"}

prepare/cards/clinc_oos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171

172172
for subset in ["small", "imbalanced", "plus"]:
173173
card = TaskCard(
174-
loader=LoadHF(path="clinc_oos", name=subset),
174+
loader=LoadHF(path="clinc/clinc_oos", name=subset),
175175
preprocess_steps=[
176176
Shuffle(page_size=sys.maxsize),
177177
Rename(field_to_field={"intent": "label"}),

prepare/cards/cnn_dailymail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from unitxt.test_utils.card import test_card
1010

1111
card = TaskCard(
12-
loader=LoadHF(path="cnn_dailymail", name="3.0.0"),
12+
loader=LoadHF(path="abisee/cnn_dailymail", name="3.0.0"),
1313
preprocess_steps=[
1414
Rename(field_to_field={"article": "document"}),
1515
Wrap(field="highlights", inside="list", to_field="summaries"),

prepare/cards/copa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from unitxt.test_utils.card import test_card
1111

1212
card = TaskCard(
13-
loader=LoadHF(path="super_glue", name="copa"),
13+
loader=LoadHF(path="aps/super_glue", name="copa"),
1414
preprocess_steps=[
1515
"splitters.small_no_test",
1616
ListFieldValues(fields=["choice1", "choice2"], to_field="choices"),

prepare/cards/dbpedia_14.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
mappers = {str(i): cls for i, cls in enumerate(classes)}
3535

3636
card = TaskCard(
37-
loader=LoadHF(path=f"{dataset_name}"),
37+
loader=LoadHF(path="fancyzhx/dbpedia_14"),
3838
preprocess_steps=[
3939
Shuffle(page_size=sys.maxsize),
4040
SplitRandomMix(

prepare/cards/ethos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
card = TaskCard(
1414
loader=LoadHF(
15-
path="ethos",
15+
path="iamollas/ethos",
1616
revision="refs/convert/parquet",
1717
data_dir="binary",
1818
splits=["train"],

prepare/cards/go_emotions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
dataset_name = "go_emotions"
1212
subset = "simplified"
1313

14-
ds_builder = load_dataset_builder(dataset_name, subset)
14+
ds_builder = load_dataset_builder("google-research-datasets/go_emotions", subset)
1515
classes = ds_builder.info.features["labels"].feature.names
1616

1717
mappers = {str(i): cls for i, cls in enumerate(classes)}
1818

1919
card = TaskCard(
20-
loader=LoadHF(path=dataset_name, name=subset),
20+
loader=LoadHF(path="google-research-datasets/go_emotions", name=subset),
2121
preprocess_steps=[
2222
MapInstanceValues(mappers={"labels": mappers}, process_every_value=True),
2323
Set(

prepare/cards/hellaswag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from unitxt.test_utils.card import test_card
55

66
card = TaskCard(
7-
loader=LoadHF(path="hellaswag"),
7+
loader=LoadHF(path="Rowan/hellaswag"),
88
preprocess_steps=[
99
"splitters.large_no_test",
1010
Rename(

prepare/cards/human_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
get_asserts = '[t for t in re.findall(r"assert.*?(?=\\n\\s*assert|$)", test.replace("candidate", entry_point), re.DOTALL)]'
1616

1717
card = TaskCard(
18-
loader=LoadHF(path="openai_humaneval", split="test"),
18+
loader=LoadHF(path="openai/openai_humaneval", split="test"),
1919
preprocess_steps=[
2020
ExecuteExpression(
2121
expression=get_asserts, imports_list=["re"], to_field="test_list"

0 commit comments

Comments
 (0)