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
change
sglang
Commits
7036d6fc
Unverified
Commit
7036d6fc
authored
Feb 25, 2025
by
Yueyang Pan
Committed by
GitHub
Feb 24, 2025
Browse files
[Bug]: Add missing clamp to llavavid (#3787)
parent
6ce9dbe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
python/sglang/srt/models/llavavid.py
python/sglang/srt/models/llavavid.py
+3
-0
No files found.
python/sglang/srt/models/llavavid.py
View file @
7036d6fc
...
@@ -110,6 +110,9 @@ class LlavaVidForCausalLM(nn.Module):
...
@@ -110,6 +110,9 @@ class LlavaVidForCausalLM(nn.Module):
if
forward_batch
.
forward_mode
.
is_extend
():
if
forward_batch
.
forward_mode
.
is_extend
():
bs
=
forward_batch
.
batch_size
bs
=
forward_batch
.
batch_size
# Clamp input ids. See llava.py for more details
input_ids
=
input_ids
.
clamp_
(
min
=
0
,
max
=
self
.
config
.
vocab_size
-
1
)
# Embed text inputs
# Embed text inputs
input_embeds
=
self
.
language_model
.
model
.
embed_tokens
(
input_ids
)
input_embeds
=
self
.
language_model
.
model
.
embed_tokens
(
input_ids
)
...
...
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