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
909f7346
Unverified
Commit
909f7346
authored
Jun 29, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Jun 29, 2023
Browse files
Remove "select_continuation_from_batch_left_padding"
parent
adef6323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
20 deletions
+0
-20
lm_eval/utils.py
lm_eval/utils.py
+0
-20
No files found.
lm_eval/utils.py
View file @
909f7346
...
...
@@ -172,26 +172,6 @@ def make_disjoint_window(pair):
return
a
[:
len
(
a
)
-
(
len
(
b
)
-
1
)],
b
def
select_continuation_from_batch_left_padding
(
generations
:
Union
[
List
[
List
[
int
]],
torch
.
Tensor
],
max_context_size
:
int
):
"""Select the continuation from the batch, removing prompts of different lengths.
Args:
generations (Union[List[List[int]], torch.Tensor]):
A tensor or list-of-lists of shape [batch_size, sequence length].
max_context_size (int):
The size of the biggest context; generations will proceed from that
index.
Example:
PAD PAD Continue : The dog chased the cat [every day of the week]
Riddle me this : The dog chased the cat [yesterday] PAD PAD PAD PAD
Output:
[every day of the week]
[yesterday] PAD PAD PAD PAD
"""
return
generations
[:,
max_context_size
:]
class
Reorderer
:
def
__init__
(
self
,
arr
,
fn
):
self
.
size
=
len
(
arr
)
...
...
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