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
b0b76d87
Unverified
Commit
b0b76d87
authored
Jul 23, 2022
by
Stella Biderman
Committed by
GitHub
Jul 23, 2022
Browse files
Merge pull request #336 from richhankins/fix_disjoint
Fix make_disjoint_window for tail case
parents
13ed1343
834de32f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
lm_eval/utils.py
lm_eval/utils.py
+1
-3
tests/test_utils.py
tests/test_utils.py
+1
-0
No files found.
lm_eval/utils.py
View file @
b0b76d87
...
...
@@ -114,10 +114,8 @@ def get_rolling_token_windows(token_list, prefix_token, max_seq_len, context_len
def
make_disjoint_window
(
pair
):
"""Takes output from get_rolling_token_windows and makes the context not overlap with the continuation"""
a
,
b
=
pair
return
a
[:
-
(
len
(
b
)
-
1
)],
b
return
a
[:
len
(
a
)
-
(
len
(
b
)
-
1
)],
b
class
Reorderer
:
...
...
tests/test_utils.py
View file @
b0b76d87
...
...
@@ -219,3 +219,4 @@ def test_make_disjoint_window():
[
2
,
3
,
4
,
5
,
6
],
)
assert
make_disjoint_window
(([
1
,
2
,
3
,
4
,
5
],
[
4
,
5
,
6
]))
==
([
1
,
2
,
3
],
[
4
,
5
,
6
])
assert
make_disjoint_window
(([
1
,
2
,
3
,
4
,
5
],
[
6
]))
==
([
1
,
2
,
3
,
4
,
5
],
[
6
])
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