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
ModelZoo
Ovis_pytorch
Commits
4feb8b89
Commit
4feb8b89
authored
Oct 14, 2024
by
luopl
Browse files
Update runner.py
parent
e01355c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
3 deletions
+0
-3
ovis/serve/runner.py
ovis/serve/runner.py
+0
-3
No files found.
ovis/serve/runner.py
View file @
4feb8b89
...
...
@@ -79,7 +79,6 @@ class OvisRunner:
def
run
(
self
,
inputs
:
List
[
Union
[
Image
.
Image
,
str
]]):
prompt
,
input_ids
,
attention_mask
,
pixel_values
=
self
.
preprocess
(
inputs
)
start_time
=
time
.
time
()
output_ids
=
self
.
model
.
generate
(
input_ids
,
pixel_values
=
pixel_values
,
...
...
@@ -87,8 +86,6 @@ class OvisRunner:
**
self
.
gen_kwargs
)
output
=
self
.
text_tokenizer
.
decode
(
output_ids
[
0
],
skip_special_tokens
=
True
)
end_time
=
time
.
time
()
print
(
f
"times****:
{
end_time
-
start_time
}
"
)
input_token_len
=
input_ids
.
shape
[
1
]
output_token_len
=
output_ids
.
shape
[
1
]
response
=
dict
(
...
...
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