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
c38b9d21
Commit
c38b9d21
authored
Jan 10, 2024
by
daniel-furman
Browse files
llama test
parent
047dde8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+3
-8
No files found.
lm_eval/models/huggingface.py
View file @
c38b9d21
...
@@ -669,23 +669,18 @@ class HFLM(LM):
...
@@ -669,23 +669,18 @@ class HFLM(LM):
"""
"""
new_reqs
=
[]
new_reqs
=
[]
for
req
in
requests
:
for
req
in
requests
:
context
,
continuation
=
req
.
args
[
0
].
strip
(),
req
.
args
[
1
]
.
strip
()
context
,
continuation
=
req
.
args
[
0
].
strip
(),
req
.
args
[
1
]
chat
=
[
chat
=
[
{
"role"
:
"system"
,
"content"
:
"You are a helpful
, respectful and honest
assistant."
},
{
"role"
:
"system"
,
"content"
:
"You are a helpful assistant."
},
{
"role"
:
"user"
,
"content"
:
context
},
{
"role"
:
"user"
,
"content"
:
context
},
{
"role"
:
"assistant"
,
"content"
:
continuation
},
]
]
single_tokenized_conversation
=
self
.
tokenizer
.
apply_chat_template
(
context
=
self
.
tokenizer
.
apply_chat_template
(
chat
,
chat
,
tokenize
=
False
,
tokenize
=
False
,
add_generation_prompt
=
True
,
add_generation_prompt
=
True
,
)
)
rfind_continuation
=
single_tokenized_conversation
.
rfind
(
continuation
)
context
=
single_tokenized_conversation
[:
rfind_continuation
]
continuation
=
single_tokenized_conversation
[
rfind_continuation
:]
req
.
args
=
(
context
,
continuation
)
req
.
args
=
(
context
,
continuation
)
new_reqs
.
append
(
req
)
new_reqs
.
append
(
req
)
return
new_reqs
return
new_reqs
def
_model_call
(
self
,
inps
,
attn_mask
=
None
,
labels
=
None
):
def
_model_call
(
self
,
inps
,
attn_mask
=
None
,
labels
=
None
):
...
...
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