Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
e4970d81
"vscode:/vscode.git/clone" did not exist on "7e9a9d32c7a9259a1bd57b0b461c36d089d26fe8"
Unverified
Commit
e4970d81
authored
Dec 24, 2023
by
Yuliang Li
Committed by
GitHub
Dec 24, 2023
Browse files
fix: incorrect argument order in `utils.divide` doc (#1208)
parent
8ffbe58a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/utils.py
lm_eval/utils.py
+3
-3
No files found.
lm_eval/utils.py
View file @
e4970d81
...
@@ -682,7 +682,7 @@ def divide(iterable, n) -> List[Iterator]:
...
@@ -682,7 +682,7 @@ def divide(iterable, n) -> List[Iterator]:
"""Divide the elements from *iterable* into *n* parts, maintaining
"""Divide the elements from *iterable* into *n* parts, maintaining
order.
order.
>>> group_1, group_2 = divide(
2,
[1, 2, 3, 4, 5, 6])
>>> group_1, group_2 = divide([1, 2, 3, 4, 5, 6]
, 2
)
>>> list(group_1)
>>> list(group_1)
[1, 2, 3]
[1, 2, 3]
>>> list(group_2)
>>> list(group_2)
...
@@ -691,14 +691,14 @@ def divide(iterable, n) -> List[Iterator]:
...
@@ -691,14 +691,14 @@ def divide(iterable, n) -> List[Iterator]:
If the length of *iterable* is not evenly divisible by *n*, then the
If the length of *iterable* is not evenly divisible by *n*, then the
length of the returned iterables will not be identical:
length of the returned iterables will not be identical:
>>> children = divide(
3,
[1, 2, 3, 4, 5, 6, 7])
>>> children = divide([1, 2, 3, 4, 5, 6, 7]
, 3
)
>>> [list(c) for c in children]
>>> [list(c) for c in children]
[[1, 2, 3], [4, 5], [6, 7]]
[[1, 2, 3], [4, 5], [6, 7]]
If the length of the iterable is smaller than n, then the last returned
If the length of the iterable is smaller than n, then the last returned
iterables will be empty:
iterables will be empty:
>>> children = divide(
5,
[1, 2, 3])
>>> children = divide([1, 2, 3]
, 5
)
>>> [list(c) for c in children]
>>> [list(c) for c in children]
[[1], [2], [3], [], []]
[[1], [2], [3], [], []]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment