DeepSeek-VL

DeepSeek-VL

高性能开源视觉语言模型 多模态理解与复杂场景应用

DeepSeek-VL是一个开源视觉语言模型,为实际应用场景而设计。它能处理逻辑图表、网页、公式、科学文献、自然图像等,并在复杂场景中展现智能。模型提供1.3B和7B两种参数规模,支持基础和对话应用,可用于学术研究和商业用途。DeepSeek-VL采用MIT许可证,为研究人员和开发者提供了强大的视觉语言处理工具。

DeepSeek-VL视觉语言模型多模态理解开源人工智能Github开源项目
<!-- markdownlint-disable first-line-h1 --> <!-- markdownlint-disable html --> <!-- markdownlint-disable no-duplicate-header --> <div align="center"> <img src="https://yellow-cdn.veclightyear.com/835a84d5/4fd454d9-01db-458b-85dd-1b81706afc78.svg" width="60%" alt="DeepSeek LLM" /> </div> <hr> <div align="center"> <a href="https://www.deepseek.com/" target="_blank"> <img alt="主页" src="https://yellow-cdn.veclightyear.com/835a84d5/16572eae-5c7b-4766-b1fd-b2c4ba4fa44b.svg" /> </a> <a href="https://huggingface.co/spaces/deepseek-ai/DeepSeek-VL-7B" target="_blank"> <img alt="聊天" src="https://img.shields.io/badge/🤖%20聊天-DeepSeek%20VL-536af5?color=536af5&logoColor=white" /> </a> <a href="https://huggingface.co/deepseek-ai" target="_blank"> <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DeepSeek%20AI-ffc107?color=ffc107&logoColor=white" /> </a> </div> <div align="center"> <a href="https://discord.gg/Tc7c45Zzu5" target="_blank"> <img alt="Discord" src="https://img.shields.io/badge/Discord-DeepSeek%20AI-7289da?logo=discord&logoColor=white&color=7289da" /> </a> <a href="images/qr.jpeg" target="_blank"> <img alt="微信" src="https://img.shields.io/badge/微信-DeepSeek%20AI-brightgreen?logo=wechat&logoColor=white" /> </a> <a href="https://twitter.com/deepseek_ai" target="_blank"> <img alt="关注Twitter" src="https://img.shields.io/badge/Twitter-deepseek_ai-white?logo=x&logoColor=white" /> </a> </div> <div align="center"> <a href="LICENSE-CODE"> <img alt="代码许可" src="https://img.shields.io/badge/代码许可-MIT-f5de53?&color=f5de53"> </a> <a href="LICENSE-MODEL"> <img alt="模型许可" src="https://img.shields.io/badge/模型许可-模型协议-f5de53?&color=f5de53"> </a> </div> <p align="center"> <a href="#3-model-downloads"><b>📥 模型下载</b></a> | <a href="#4-quick-start"><b>⚡ 快速开始</b></a> | <a href="#5-license"><b>📜 许可证</b></a> | <a href="#6-citation"><b>📖 引用</b></a> <br> <a href="https://arxiv.org/abs/2403.05525"><b>📄 论文链接</b></a> | <a href="https://huggingface.co/papers/2403.05525"><b>🤗 Huggingface论文链接</b></a> | <a href="https://huggingface.co/spaces/deepseek-ai/DeepSeek-VL-7B"><b>👁️ 演示</b></a> </p>

1. 简介

介绍DeepSeek-VL,这是一个为实际视觉和语言理解应用设计的开源视觉语言(VL)模型。DeepSeek-VL具有通用的多模态理解能力,能够处理逻辑图表、网页、公式识别、科学文献、自然图像,以及复杂场景中的具身智能。

DeepSeek-VL:迈向真实世界的视觉语言理解

卢浩宇*、刘文*、张博**、王冰轩、董凯、刘博、孙敬翔、任卓声、李卓书、杨浩、孙耀锋、邓成奇、徐瀚威、谢震达、阮冲(*共同第一作者,**项目负责人)

2. 发布

<details> <summary>✅ <b>2024-03-14</b>:DeepSeek-VL-7B的演示在<a href="https://huggingface.co/spaces/deepseek-ai/DeepSeek-VL-7B">Hugging Face</a>上可用。</summary> <br>请在<a href="https://huggingface.co/spaces/deepseek-ai/DeepSeek-VL-7B">https://huggingface.co/spaces/deepseek-ai/DeepSeek-VL-7B</a>查看DeepSeek-VL-7B的gradio演示。亲身体验其功能! </details> <details> <summary>✅ <b>2024-03-13</b>:支持DeepSeek-VL gradio演示。 </details> <details> <summary>✅ <b>2024-03-11</b>:DeepSeek-VL系列发布,包括<code>DeepSeek-VL-7B-base</code>、<code>DeepSeek-VL-7B-chat</code>、<code>DeepSeek-VL-1.3B-base</code>和<code>DeepSeek-VL-1.3B-chat</code>。</summary> <br>此次发布包括DeepSeek-VL系列中为各种应用定制的多样化模型。这些模型有两种规模:7B和1.3B参数,每种规模都提供基础和聊天变体,以满足不同的需求和集成场景。 </details>

3. 模型下载

我们向公众发布了DeepSeek-VL系列,包括1.3B-base、1.3B-chat、7b-base和7b-chat模型,以支持学术和商业社区内更广泛、更多样化的研究。请注意,本模型的使用受许可证部分中概述的条款约束。根据这些条款,允许商业使用。

Huggingface

模型序列长度下载链接
DeepSeek-VL-1.3B-base4096🤗 Hugging Face
DeepSeek-VL-1.3B-chat4096🤗 Hugging Face
DeepSeek-VL-7B-base4096🤗 Hugging Face
DeepSeek-VL-7B-chat4096🤗 Hugging Face

4. 快速入门

安装

在Python 3.8或更高版本的环境中,运行以下命令安装必要的依赖项:

pip install -e .

简单推理示例

import torch from transformers import AutoModelForCausalLM from deepseek_vl.models import VLChatProcessor, MultiModalityCausalLM from deepseek_vl.utils.io import load_pil_images # 指定模型路径 model_path = "deepseek-ai/deepseek-vl-7b-chat" vl_chat_processor: VLChatProcessor = VLChatProcessor.from_pretrained(model_path) tokenizer = vl_chat_processor.tokenizer vl_gpt: MultiModalityCausalLM = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True) vl_gpt = vl_gpt.to(torch.bfloat16).cuda().eval() ## 单图对话示例 conversation = [ { "role": "User", "content": "<image_placeholder>描述这张图片的每个阶段。", "images": ["./images/training_pipelines.jpg"], }, {"role": "Assistant", "content": ""}, ] ## 多图(或上下文学习)对话示例 # conversation = [ # { # "role": "User", # "content": "<image_placeholder>前景中的狗没有穿任何东西," # "<image_placeholder>一只戴着圣诞帽的狗," # "<image_placeholder>一只穿着巫师服装的狗,以及" # "<image_placeholder>这只狗穿着什么?", # "images": [ # "images/dog_a.png", # "images/dog_b.png", # "images/dog_c.png", # "images/dog_d.png", # ], # }, # {"role": "Assistant", "content": ""} # ] # 加载图片并准备输入 pil_images = load_pil_images(conversation) prepare_inputs = vl_chat_processor( conversations=conversation, images=pil_images, force_batchify=True ).to(vl_gpt.device) # 运行图像编码器获取图像嵌入 inputs_embeds = vl_gpt.prepare_inputs_embeds(**prepare_inputs) # 运行模型获取响应 outputs = vl_gpt.language_model.generate( inputs_embeds=inputs_embeds, attention_mask=prepare_inputs.attention_mask, pad_token_id=tokenizer.eos_token_id, bos_token_id=tokenizer.bos_token_id, eos_token_id=tokenizer.eos_token_id, max_new_tokens=512, do_sample=False, use_cache=True ) answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=True) print(f"{prepare_inputs['sft_format'][0]}", answer)

命令行聊天

python cli_chat.py --model_path "deepseek-ai/deepseek-vl-7b-chat" # 或本地路径 python cli_chat.py --model_path "本地模型路径"

Gradio演示

pip install -e .[gradio] python deepseek_vl/serve/app_deepseek.py

玩得开心!

5. 许可证

此代码仓库采用MIT许可证。DeepSeek-VL Base/Chat模型的使用受DeepSeek模型许可证约束。DeepSeek-VL系列(包括Base和Chat)支持商业使用。

6. 引用

@misc{lu2024deepseekvl,
      title={DeepSeek-VL: Towards Real-World Vision-Language Understanding},
      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 Hao Yang and Yaofeng Sun and Chengqi Deng and Hanwei Xu and Zhenda Xie and Chong Ruan},
      year={2024},
      eprint={2403.05525},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}

7. 联系方式

如果您有任何问题,请提出issue或通过service@deepseek.com联系我们。

编辑推荐精选

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

Keevx

Keevx

AI数字人视频创作平台

Keevx 一款开箱即用的AI数字人视频创作平台,广泛适用于电商广告、企业培训与社媒宣传,让全球企业与个人创作者无需拍摄剪辑,就能快速生成多语言、高质量的专业视频。

即梦AI

即梦AI

一站式AI创作平台

提供 AI 驱动的图片、视频生成及数字人等功能,助力创意创作

扣子-AI办公

扣子-AI办公

AI办公助手,复杂任务高效处理

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
下拉加载更多