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
b7a4ea06
Unverified
Commit
b7a4ea06
authored
Nov 06, 2023
by
Lintang Sutawika
Committed by
GitHub
Nov 06, 2023
Browse files
Merge pull request #952 from EleutherAI/fixup-logging
[Refactor] Logging fixes
parents
01227a7e
9e5648b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
lm_eval/evaluator.py
lm_eval/evaluator.py
+0
-5
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+6
-2
No files found.
lm_eval/evaluator.py
View file @
b7a4ea06
...
...
@@ -2,7 +2,6 @@ import random
import
itertools
import
json
import
collections
import
logging
import
sys
import
torch
...
...
@@ -25,10 +24,6 @@ from lm_eval.utils import (
from
lm_eval.logger
import
eval_logger
logger
=
logging
.
getLogger
(
__name__
)
logger
.
setLevel
(
logging
.
INFO
)
logger
.
addHandler
(
logging
.
StreamHandler
(
sys
.
stdout
))
@
positional_deprecated
def
simple_evaluate
(
...
...
lm_eval/models/huggingface.py
View file @
b7a4ea06
...
...
@@ -675,7 +675,8 @@ class HFLM(LM):
else
None
,
)
for
chunk
in
tqdm
(
chunks
,
disable
=
(
disable_tqdm
or
(
self
.
rank
!=
0
))):
pbar
=
tqdm
(
total
=
len
(
requests
),
disable
=
(
disable_tqdm
or
(
self
.
rank
!=
0
)))
for
chunk
in
chunks
:
inps
=
[]
cont_toks_list
=
[]
inplens
=
[]
...
...
@@ -812,6 +813,9 @@ class HFLM(LM):
res
.
append
(
answer
)
self
.
cache_hook
.
add_partial
(
"loglikelihood"
,
cache_key
,
answer
)
pbar
.
update
(
1
)
pbar
.
close
()
return
re_ord
.
get_original
(
res
)
...
...
@@ -857,7 +861,7 @@ class HFLM(LM):
if
self
.
batch_size
==
"auto"
and
not
adaptive_batch_size
else
None
,
)
for
chunk
in
tqdm
(
chunks
,
disable
=
self
.
rank
!=
0
)
:
for
chunk
in
chunks
:
contexts
,
all_gen_kwargs
=
zip
(
*
chunk
)
# we assume all gen kwargs in the batch are the same
# this is safe to assume because the `grouper` object ensures it.
...
...
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