Skip to content

Commit ca55da9

Browse files
committed
last touches in bfcl, reviewing whole datasets
Signed-off-by: dafnapension <[email protected]>
1 parent bcd847e commit ca55da9

File tree

13 files changed

+19
-21
lines changed

13 files changed

+19
-21
lines changed

docs/docs/adding_operator.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ There are several types of operators.
4040
1. Field Operators - Operators that modify individual fields of the instances in the input streams. Example of such operators are operators that
4141
cast field values, uppercase string fields, or translate text between languages.
4242

43-
1. Instance Operators - Operators that modify individual instances in the input streams. For example, operators that add or remove fields.
43+
2. Instance Operators - Operators that modify individual instances in the input streams. For example, operators that add or remove fields.
4444

45-
2. Stream Operators - Operators that perform operations on full streams. For example, operators that remove instances based on some condition.
45+
3. Stream Operators - Operators that perform operations on full streams. For example, operators that remove instances based on some condition.
4646

47-
3. MultiStream Operators - Operator that perform operations on multiple streams. For example, operators that repartition the instances between train and test splits.
47+
4. MultiStream Operators - Operator that perform operations on multiple streams. For example, operators that repartition the instances between train and test splits.
4848

4949
Unitxt comes with a large collection of built in operators - that were design to cover most common requirements of dataset processing.
5050

prepare/cards/bfcl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@
7575
for subset in [
7676
"simple",
7777
"multiple",
78-
"live_multiple",
78+
"live_multiple", # instances above 900 reach size of hundreds of MBs
7979
"live_simple",
8080
"java",
8181
"javascript",
8282
"parallel",
83-
"parallel_multiple",
83+
"parallel_multiple", # error caused by instance 179, hence expression now constrains: if isinstance(v, dict)
8484
"live_parallel",
8585
"live_parallel_multiple",
8686
]:
@@ -105,7 +105,7 @@
105105
Copy(field="function", to_field="tools"),
106106
FixJsonSchemaOfToolParameterTypes(),
107107
ExecuteExpression(
108-
expression='[{"name": k, "arguments": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]',
108+
expression='[{"name": k, "arguments": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]',
109109
to_field="reference_calls",
110110
imports_list=["itertools"],
111111
),

src/unitxt/catalog/cards/bfcl/multi_turn/java_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/javascript_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/live_multiple_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/live_parallel_multiple_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/live_parallel_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/live_simple_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/multiple_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

src/unitxt/catalog/cards/bfcl/multi_turn/parallel_multiple_v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"__type__": "execute_expression",
38-
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() for vals in itertools.product(*v.values())]",
38+
"expression": "[{\"name\": k, \"arguments\": dict(zip(v.keys(), vals))} for d in ground_truth for k, v in d.items() if isinstance(v, dict) for vals in itertools.product(*v.values())]",
3939
"to_field": "reference_calls",
4040
"imports_list": [
4141
"itertools"

0 commit comments

Comments
 (0)