mirror of
https://github.com/deepseek-ai/DeepSeek-VL2
synced 2025-01-22 04:15:30 +00:00
update readme and repo dependency
This commit is contained in:
parent
cd4bb743e2
commit
8bde1c1ae1
19
README.md
19
README.md
@ -124,6 +124,23 @@ conversation = [
|
||||
{"role": "<|Assistant|>", "content": ""},
|
||||
]
|
||||
|
||||
|
||||
# multiple images/interleaved image-text
|
||||
conversation_multi_images = [
|
||||
{
|
||||
"role": "<|User|>",
|
||||
"content": "This is image_1: <image>\n"
|
||||
"This is image_2: <image>\n"
|
||||
"This is image_3: <image>\n If I am a vegetarian, what can I cook with these ingredients?",
|
||||
"images": [
|
||||
"images/multi_image_1.png",
|
||||
"images/multi_image_2.jpg",
|
||||
"images/multi_image_3.jpg",
|
||||
],
|
||||
},
|
||||
{"role": "<|Assistant|>", "content": ""}
|
||||
]
|
||||
|
||||
# load images and prepare for inputs
|
||||
pil_images = load_pil_images(conversation)
|
||||
prepare_inputs = vl_chat_processor(
|
||||
@ -148,7 +165,7 @@ outputs = vl_gpt.language.generate(
|
||||
use_cache=True
|
||||
)
|
||||
|
||||
answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=True)
|
||||
answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=False)
|
||||
print(f"{prepare_inputs['sft_format'][0]}", answer)
|
||||
```
|
||||
|
||||
|
BIN
images/multi_image_1.png
Normal file
BIN
images/multi_image_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 855 KiB |
BIN
images/multi_image_2.jpg
Normal file
BIN
images/multi_image_2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
BIN
images/multi_image_3.jpg
Normal file
BIN
images/multi_image_3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 140 KiB |
@ -1,5 +1,5 @@
|
||||
torch==2.0.1
|
||||
transformers>=4.38.2
|
||||
transformers==4.38.2
|
||||
timm>=0.9.16
|
||||
accelerate
|
||||
sentencepiece
|
||||
|
Loading…
Reference in New Issue
Block a user