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
34ae15c6
"tinychat/README.md" did not exist on "79048993bb048ed5bee5819baa7888668c493ca9"
Commit
34ae15c6
authored
Jun 28, 2025
by
Baber
Browse files
re-arrange imports
parent
65425258
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lm_eval/api/model.py
lm_eval/api/model.py
+4
-2
No files found.
lm_eval/api/model.py
View file @
34ae15c6
...
...
@@ -5,8 +5,6 @@ import logging
import
os
from
typing
import
Dict
,
List
,
Optional
,
Tuple
,
Type
,
TypeVar
,
Union
import
transformers
from
sqlitedict
import
SqliteDict
from
tqdm
import
tqdm
from
lm_eval
import
utils
...
...
@@ -238,6 +236,8 @@ class CachingLM:
:param cache_db: str
Path to cache db
"""
from
sqlitedict
import
SqliteDict
self
.
lm
=
lm
self
.
cache_db
=
cache_db
if
os
.
path
.
dirname
(
cache_db
):
...
...
@@ -344,6 +344,8 @@ class TemplateLM(LM):
def
_encode_pair
(
self
,
context
:
str
,
continuation
:
str
)
->
Tuple
[
List
[
int
],
List
[
int
]]:
import
transformers
n_spaces
=
len
(
context
)
-
len
(
context
.
rstrip
())
if
n_spaces
>
0
:
continuation
=
context
[
-
n_spaces
:]
+
continuation
...
...
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