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
OpenDAS
opencompass
Commits
77745a84
"...composable_kernel-1.git" did not exist on "6d4450ef155c39af9ede2cd171be40ee06db9939"
Unverified
Commit
77745a84
authored
Aug 24, 2023
by
LZHgrla
Committed by
GitHub
Aug 24, 2023
Browse files
[Fix] Fix bugs for PeftModel generate (#252)
* fix bugs * fix typo
parent
2a5cef29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
opencompass/models/huggingface.py
opencompass/models/huggingface.py
+3
-1
No files found.
opencompass/models/huggingface.py
View file @
77745a84
...
@@ -203,7 +203,9 @@ class HuggingFace(BaseModel):
...
@@ -203,7 +203,9 @@ class HuggingFace(BaseModel):
max_length
=
self
.
max_seq_len
-
max_length
=
self
.
max_seq_len
-
max_out_len
)[
'input_ids'
]
max_out_len
)[
'input_ids'
]
input_ids
=
torch
.
tensor
(
input_ids
,
device
=
self
.
model
.
device
)
input_ids
=
torch
.
tensor
(
input_ids
,
device
=
self
.
model
.
device
)
outputs
=
self
.
model
.
generate
(
input_ids
,
# To accommodate the PeftModel, parameters should be passed in
# key-value format for generate.
outputs
=
self
.
model
.
generate
(
input_ids
=
input_ids
,
max_new_tokens
=
max_out_len
,
max_new_tokens
=
max_out_len
,
**
kwargs
)
**
kwargs
)
...
...
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