"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "77321481247787c97568c3b9f64b19e22351bab8"
Unverified Commit ffa04def authored by Ligeng Zhu's avatar Ligeng Zhu Committed by GitHub
Browse files

Fix wrong examples in llava usage. (#28020)

* Fix wrong examples in llava usage.

* Update modeling_llava.py
parent 29a1c1b4
...@@ -370,12 +370,12 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel): ...@@ -370,12 +370,12 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel):
>>> url = "https://www.ilankelman.org/stopsigns/australia.jpg" >>> url = "https://www.ilankelman.org/stopsigns/australia.jpg"
>>> image = Image.open(requests.get(url, stream=True).raw) >>> image = Image.open(requests.get(url, stream=True).raw)
>>> inputs = processor(text=text, images=image, return_tensors="pt") >>> inputs = processor(text=prompt, images=image, return_tensors="pt")
>>> # Generate >>> # Generate
>>> generate_ids = model.generate(**inputs, max_length=30) >>> generate_ids = model.generate(**inputs, max_length=30)
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0] >>> processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
"There seems to be a stop sign" "\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 output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment