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
1e2428a2
Unverified
Commit
1e2428a2
authored
Mar 18, 2025
by
Baber Abbasi
Committed by
GitHub
Mar 18, 2025
Browse files
[hf-multimodal] pass kwargs to self.processor (#2667)
* add min_pixels, max_pixels * fix
parent
80a10075
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lm_eval/models/hf_vlms.py
lm_eval/models/hf_vlms.py
+6
-0
No files found.
lm_eval/models/hf_vlms.py
View file @
1e2428a2
...
...
@@ -45,6 +45,8 @@ class HFMultimodalLM(HFLM):
# TODO: handle whitespace in image placeholder (replacement)
max_images
:
Optional
[
int
]
=
999
,
convert_img_format
=
False
,
min_pixels
:
Optional
[
int
]
=
None
,
max_pixels
:
Optional
[
int
]
=
None
,
**
kwargs
,
):
# We initialize using HFLM's init. Sub-methods like _create_model and _create_tokenizer
...
...
@@ -63,6 +65,9 @@ class HFMultimodalLM(HFLM):
self
.
interleave
=
interleave
self
.
max_images
=
max_images
self
.
rgb
=
convert_img_format
self
.
pixels
=
({
"min_pixels"
:
min_pixels
}
if
min_pixels
else
{})
|
(
{
"max_pixels"
:
max_pixels
}
if
max_pixels
else
{}
)
# WARNING: improperly set image_token_id can lead to ignored image input or other (potentially silent) errors!
if
not
image_string
:
self
.
image_token_id
=
(
...
...
@@ -135,6 +140,7 @@ class HFMultimodalLM(HFLM):
model_name
,
revision
=
revision
,
trust_remote_code
=
trust_remote_code
,
**
self
.
pixels
,
# use_fast=use_fast_tokenizer,
)
...
...
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