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
df94cfdd
Commit
df94cfdd
authored
Jan 23, 2025
by
Baber
Browse files
nit
parent
4ee812a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/models/rwkvwrapper.py
lm_eval/models/rwkvwrapper.py
+3
-3
No files found.
lm_eval/models/rwkvwrapper.py
View file @
df94cfdd
...
...
@@ -90,9 +90,8 @@ class RWKVWRAPPER(HFLM):
local_dir
=
"rwkv_model"
,
)
self
.
_model
=
RWKV
(
model
=
f
"rwkv_model/
{
pretrained
}
"
,
strategy
=
f
"cuda
{
dtype
}
"
)
self
.
_model
=
RWKV
(
model
=
f
"rwkv_model/
{
pretrained
}
"
,
strategy
=
"cuda fp16"
)
self
.
_model
.
tie_weights
=
lambda
:
None
def
_model_generate
(
self
,
context
,
max_length
,
stop
,
**
generation_kwargs
):
remove_arg
=
(
...
...
@@ -105,6 +104,7 @@ class RWKVWRAPPER(HFLM):
all_outputs
=
[]
if
not
self
.
is_hf
:
CHUNK_SIZE
=
4096
context
=
context
.
squeeze
()
prefill_ids
,
next_token
=
context
[:
-
1
],
context
[
-
1
]
state
=
None
for
i
in
range
(
0
,
len
(
prefill_ids
),
CHUNK_SIZE
):
...
...
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