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
047dde8c
Commit
047dde8c
authored
Jan 10, 2024
by
daniel-furman
Browse files
llama test
parent
b6c75ed1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+9
-6
No files found.
lm_eval/models/huggingface.py
View file @
047dde8c
...
...
@@ -673,18 +673,21 @@ class HFLM(LM):
chat
=
[
{
"role"
:
"system"
,
"content"
:
"You are a helpful, respectful and honest assistant."
},
{
"role"
:
"user"
,
"content"
:
context
},
{
"role"
:
"assistant"
,
"content"
:
continuation
},
]
context
=
self
.
tokenizer
.
apply_chat_template
(
single_tokenized_conversation
=
self
.
tokenizer
.
apply_chat_template
(
chat
,
tokenize
=
False
,
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
)
new_reqs
.
append
(
req
)
return
new_reqs
def
_model_call
(
self
,
inps
,
attn_mask
=
None
,
labels
=
None
):
"""
:param inps: torch.Tensor
...
...
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