poiuy741741 commited on
Commit
7621850
1 Parent(s): 6f16f00

Rename README.md to 我们地球上有汽车。老虎.md

Browse files
Files changed (2) hide show
  1. README.md +0 -128
  2. 我们地球上有汽车。老虎.md +137 -0
README.md DELETED
@@ -1,128 +0,0 @@
1
- ---
2
- license: other
3
- license_name: deepseek
4
- license_link: LICENSE
5
- pipeline_tag: image-text-to-text
6
- ---
7
-
8
- ## 1. Introduction
9
-
10
- Introducing DeepSeek-VL, an open-source Vision-Language (VL) Model designed for real-world vision and language understanding applications. DeepSeek-VL possesses general multimodal understanding capabilities, capable of processing logical diagrams, web pages, formula recognition, scientific literature, natural images, and embodied intelligence in complex scenarios.
11
-
12
- [DeepSeek-VL: Towards Real-World Vision-Language Understanding](https://arxiv.org/abs/2403.05525)
13
-
14
- [**Github Repository**](https://github.com/deepseek-ai/DeepSeek-VL)
15
-
16
- Haoyu Lu*, Wen Liu*, Bo Zhang**, Bingxuan Wang, Kai Dong, Bo Liu, Jingxiang Sun, Tongzheng Ren, Zhuoshu Li, Hao Yang, Yaofeng Sun, Chengqi Deng, Hanwei Xu, Zhenda Xie, Chong Ruan (*Equal Contribution, **Project Lead)
17
-
18
- ![](https://github.com/deepseek-ai/DeepSeek-VL/blob/main/images/sample.jpg)
19
-
20
-
21
- ### 2. Model Summary
22
-
23
- DeepSeek-VL-7b-base uses the [SigLIP-L](https://huggingface.co/timm/ViT-L-16-SigLIP-384) and [SAM-B](https://huggingface.co/facebook/sam-vit-base) as the hybrid vision encoder supporting 1024 x 1024 image input
24
- and is constructed based on the DeepSeek-LLM-7b-base which is trained on an approximate corpus of 2T text tokens. The whole DeepSeek-VL-7b-base model is finally trained around 400B vision-language tokens.
25
- DeekSeel-VL-7b-chat is an instructed version based on [DeepSeek-VL-7b-base](https://huggingface.co/deepseek-ai/deepseek-vl-7b-base).
26
-
27
-
28
- ## 3. Quick Start
29
-
30
- ### Installation
31
-
32
- On the basis of `Python >= 3.8` environment, install the necessary dependencies by running the following command:
33
-
34
-
35
- ```shell
36
- git clone https://github.com/deepseek-ai/DeepSeek-VL
37
- cd DeepSeek-VL
38
-
39
- pip install -e .
40
- ```
41
-
42
- ### Simple Inference Example
43
-
44
- ```python
45
- import torch
46
- from transformers import AutoModelForCausalLM
47
-
48
- from deepseek_vl.models import VLChatProcessor, MultiModalityCausalLM
49
- from deepseek_vl.utils.io import load_pil_images
50
-
51
-
52
- # specify the path to the model
53
- model_path = "deepseek-ai/deepseek-vl-7b-chat"
54
- vl_chat_processor: VLChatProcessor = VLChatProcessor.from_pretrained(model_path)
55
- tokenizer = vl_chat_processor.tokenizer
56
-
57
- vl_gpt: MultiModalityCausalLM = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True)
58
- vl_gpt = vl_gpt.to(torch.bfloat16).cuda().eval()
59
-
60
- conversation = [
61
- {
62
- "role": "User",
63
- "content": "<image_placeholder>Describe each stage of this image.",
64
- "images": ["./images/training_pipelines.png"]
65
- },
66
- {
67
- "role": "Assistant",
68
- "content": ""
69
- }
70
- ]
71
-
72
- # load images and prepare for inputs
73
- pil_images = load_pil_images(conversation)
74
- prepare_inputs = vl_chat_processor(
75
- conversations=conversation,
76
- images=pil_images,
77
- force_batchify=True
78
- ).to(vl_gpt.device)
79
-
80
- # run image encoder to get the image embeddings
81
- inputs_embeds = vl_gpt.prepare_inputs_embeds(**prepare_inputs)
82
-
83
- # run the model to get the response
84
- outputs = vl_gpt.language_model.generate(
85
- inputs_embeds=inputs_embeds,
86
- attention_mask=prepare_inputs.attention_mask,
87
- pad_token_id=tokenizer.eos_token_id,
88
- bos_token_id=tokenizer.bos_token_id,
89
- eos_token_id=tokenizer.eos_token_id,
90
- max_new_tokens=512,
91
- do_sample=False,
92
- use_cache=True
93
- )
94
-
95
- answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=True)
96
- print(f"{prepare_inputs['sft_format'][0]}", answer)
97
- ```
98
-
99
- ### CLI Chat
100
- ```bash
101
-
102
- python cli_chat.py --model_path "deepseek-ai/deepseek-vl-7b-chat"
103
-
104
- # or local path
105
- python cli_chat.py --model_path "local model path"
106
-
107
- ```
108
-
109
- ## 4. License
110
-
111
- This code repository is licensed under [the MIT License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-CODE). The use of DeepSeek-VL Base/Chat models is subject to [DeepSeek Model License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-MODEL). DeepSeek-VL series (including Base and Chat) supports commercial use.
112
-
113
- ## 5. Citation
114
-
115
- ```
116
- @misc{lu2024deepseekvl,
117
- title={DeepSeek-VL: Towards Real-World Vision-Language Understanding},
118
- author={Haoyu Lu and Wen Liu and Bo Zhang and Bingxuan Wang and Kai Dong and Bo Liu and Jingxiang Sun and Tongzheng Ren and Zhuoshu Li and Yaofeng Sun and Chengqi Deng and Hanwei Xu and Zhenda Xie and Chong Ruan},
119
- year={2024},
120
- eprint={2403.05525},
121
- archivePrefix={arXiv},
122
- primaryClass={cs.AI}
123
- }
124
- ```
125
-
126
- ## 6. Contact
127
-
128
- If you have any questions, please raise an issue or contact us at [[email protected]](mailto:[email protected]).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
我们地球上有汽车。老虎.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ 许可证_名称: Deepseek
3
+ 许可证_链接: 许可证
4
+ 管道_标签: 图像文本到文本
5
+ license: bigscience-openrail-m
6
+ datasets:
7
+ - HuggingFaceTB/cosmopedia
8
+ language:
9
+ - ar
10
+ metrics:
11
+ - brier_score
12
+ library_name: bertopic
13
+ tags:
14
+ - art
15
+ ---
16
+
17
+ ## 1. 导言
18
+
19
+ 介绍 DeepSeek-VL ,一种用于实际世界视觉和语言理解应用程序的开源视觉语言( VL )模型。 DeepSeek-VL 具有一般的多模式理解能力,能够处理逻辑图、网页、公式识别、科学文献、自然图像,并在复杂场景中体现智力。
20
+
21
+ [DeepSeek-VL:实现真正的世界愿景语言理解](https://arxiv.org/abs/2403.05525)
22
+
23
+ [**Github存储库**](https://github.com/deepseek-ai/DeepSeek-VL)
24
+
25
+ 浩宇路*、文刘*、波张**、王炳轩、开东、波刘、景祥孙、同正人、卓树李、浩阳、姚峰孙、程琦邓、韩伟徐、振大谢、崇阮(*等贡献,**项目领先)
26
+
27
+ !](https://github.com/deepseek-ai/DeepSeek-VL/blob/main/images/sample.jpg)
28
+
29
+
30
+ ### 2. 示范摘要
31
+
32
+ DeepSeek-VL-7b [Siglip L](https://huggingface.co/timm/ViT-L-16-SigLIP-384) 和 [SAM-B](https://huggingface.co/facebook/sam-vit-base) 作为支持1024x1024图像输入的混合视觉编码器
33
+ 并且基于 DeePSeek-LLM-7b 基结构,该基体在 2 T 文本令牌的近似语料库上进行训练。 整个 DeepSeek-VL-7b 基模型最终在 400 B 视觉语言令牌上进行了训练。
34
+ DeekSeel-VL-7b-chat 是一个基于 [DeepSeek-VL-7b-base](https://huggingface.co/deepseek-ai/deepseek-vl-7b-base).
35
+
36
+
37
+ ## 3. 快速开始
38
+
39
+ ### 安装
40
+
41
+ ▲图为,采用以下命令安装必要的依赖项:
42
+
43
+
44
+ ```贝壳
45
+ GIT 克隆 https://github.com/deepseek-ai/DeepSeek-VL
46
+ CD DeepSeek-VL
47
+
48
+ PIP安装-E。
49
+ ```
50
+
51
+ ### 简单推理示例
52
+
53
+ ```蟒蛇
54
+ 进口火炬
55
+ 汽车模型
56
+
57
+ Tepseek_vl 模型
58
+ 从 deepseek_vl.utils.io 导入负载_pil_ages
59
+
60
+
61
+ # 指定通往模型的路径
62
+ Model_path = "Deepseek-I/Deepseek-VL-7b-chat"
63
+ VL_chat_croptor: VLCHATProcessor = VLCHATProcessor.fropreed (Model_path)
64
+ 托格纳
65
+
66
+ VL_gpt: 多模态 CausalLM = AutoModelForCausalLM.ropreed (Model_path 、Trust_remote_code=True)
67
+ VL_GPT = VL_gpt.to (Torch.bfloat16).cuda (.eeval ()
68
+
69
+ 对话=[
70
+ {
71
+ “角色”:“用户”,
72
+ “内容”:“《形象_占位符>描述这个图像的每个阶段。”
73
+ "图像":["./images/training_pipelines.png"
74
+ },
75
+ {
76
+ “角色”:“助理”,
77
+ "内容":"
78
+ }
79
+ ]
80
+
81
+ # 加载图像并准备输入
82
+ pil_images = load_pil_images(conversation)
83
+ 准备_inputs=vl_chat_cropressor(
84
+ 对话
85
+ 图像=pil_mages,
86
+ 力量_batchify=True
87
+ )to(vl_gpt.device)
88
+
89
+ # 运行图像编码器以获取图像嵌入
90
+ 输入_embeds =vl_gpt.prepare_inputs_embeds (**prepare_inputs)
91
+
92
+ # 运行模型以获取响应
93
+ outputs = vl_gpt.language_model.generate(
94
+ inputs_embeds=inputs_embeds,
95
+ attention_mask=prepare_inputs.attention_mask,
96
+ pad_token_id=tokenizer.eos_token_id,
97
+ bos_token_id=tokenizer.bos_token_id,
98
+ eos_token_id=tokenizer.eos_token_id,
99
+ max_new_tokens=512,
100
+ do_sample=False,
101
+ use_cache=True
102
+ )
103
+
104
+ answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=True)
105
+ print(f"{prepare_inputs['sft_format'][0]}", answer)
106
+ ```
107
+
108
+ ### CLI Chat
109
+ ```bash
110
+
111
+ python cli_chat.py --model_path "deepseek-ai/deepseek-vl-7b-chat"
112
+
113
+ # or local path
114
+ python cli_chat.py --model_path "local model path"
115
+
116
+ ```
117
+
118
+ ## 4. License
119
+
120
+ 此代码存储库在 [the MIT License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-CODE). The use of DeepSeek-VL Base/Chat models is subject to [DeepSeek Model License](https://github.com/deepseek-ai/DeepSeek-LLM/blob/HEAD/LICENSE-MODEL). DeepSeek-VL series (including Base and Chat) supports commercial use.
121
+
122
+ ## 5. Citation
123
+
124
+ ```
125
+ @misc{lu2024deepseekvl,
126
+ title={DeepSeek-VL: Towards Real-World Vision-Language Understanding},
127
+ author={Haoyu Lu and Wen Liu and Bo Zhang and Bingxuan Wang and Kai Dong and Bo Liu and Jingxiang Sun and Tongzheng Ren and Zhuoshu Li and Yaofeng Sun and Chengqi Deng and Hanwei Xu and Zhenda Xie and Chong Ruan},
128
+ year={2024},
129
+ eprint={2403.05525},
130
+ archivePrefix={arXiv},
131
+ primaryClass={cs.AI}
132
+ }
133
+ ```
134
+
135
+ ## 6. Contact
136
+
137
+ 如有疑问,请提出问题或在 [[email protected]](mailto:[email protected]).