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
chenpangpang
transformers
Commits
ffa04def
Unverified
Commit
ffa04def
authored
Dec 16, 2023
by
Ligeng Zhu
Committed by
GitHub
Dec 15, 2023
Browse files
Fix wrong examples in llava usage. (#28020)
* Fix wrong examples in llava usage. * Update modeling_llava.py
parent
29a1c1b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/models/llava/modeling_llava.py
src/transformers/models/llava/modeling_llava.py
+3
-3
No files found.
src/transformers/models/llava/modeling_llava.py
View file @
ffa04def
...
...
@@ -370,12 +370,12 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel):
>>> url = "https://www.ilankelman.org/stopsigns/australia.jpg"
>>> image = Image.open(requests.get(url, stream=True).raw)
>>> inputs = processor(text=
tex
t, images=image, return_tensors="pt")
>>> inputs = processor(text=
promp
t, images=image, return_tensors="pt")
>>> # Generate
>>> generate_ids = model.generate(**inputs, max_length=30)
>>>
tokenize
r.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
"
There seems to be a stop sign
"
>>>
processo
r.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
"
\nUSER: What's the content of the image?\nASSISTANT: The image features a stop sign on a street corner
"
```"""
output_attentions
=
output_attentions
if
output_attentions
is
not
None
else
self
.
config
.
output_attentions
...
...
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