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
446ea332
Unverified
Commit
446ea332
authored
Sep 19, 2024
by
Li Bo
Committed by
GitHub
Sep 19, 2024
Browse files
fix: creat new dict everytime for putting new frame (#1464)
parent
8f527e29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
examples/runtime/llava_onevision/http_llava_onevision_test.py
...ples/runtime/llava_onevision/http_llava_onevision_test.py
+6
-9
No files found.
examples/runtime/llava_onevision/http_llava_onevision_test.py
View file @
446ea332
...
...
@@ -217,17 +217,14 @@ def prepare_video_messages(video_path):
base64_frames
.
append
(
base64_str
)
messages
=
[{
"role"
:
"user"
,
"content"
:
[]}]
frame_format
=
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
:
"data:image/jpeg;base64,{}"
},
"modalities"
:
"video"
,
}
for
base64_frame
in
base64_frames
:
frame_format
[
"image_url"
][
"url"
]
=
"data:image/jpeg;base64,{}"
.
format
(
base64_frame
)
messages
[
0
][
"content"
].
append
(
frame_format
.
copy
())
frame_format
=
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
:
f
"data:image/jpeg;base64,
{
base64_frame
}
"
},
"modalities"
:
"video"
,
}
messages
[
0
][
"content"
].
append
(
frame_format
)
prompt
=
{
"type"
:
"text"
,
"text"
:
"Please describe the video in detail."
}
messages
[
0
][
"content"
].
append
(
prompt
)
...
...
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