PaperAgent 2024年09月05日
Qwen2-VL发布,支持复杂推理与决策的可视化Agent!
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

阿里发布Qwen2-VL,开源部分型号,在视觉理解、视频处理、设备操作等方面表现出色,具有多种新特性和功能。

🎯Qwen2-VL在视觉理解基准上实现先进性能,能处理各种分辨率和比例的图像,在MathVista、DocVQA等多个方面表现优异。

🎬借助在线流媒体功能,Qwen2-VL可理解20分钟以上视频,通过问答、对话、内容创作等方式进行处理。

🤖Qwen2-VL具有复杂推理和决策能力,可与手机、机器人等设备集成,根据视觉环境和文本指令自动操作。

🌐Qwen2-VL支持多语言,除英语和中文外,还包括多数欧洲语言、日语、韩语等,服务全球用户。

📐Qwen2-VL的模型架构更新,可处理任意图像分辨率,采用多模态旋转位置嵌入增强多模态处理能力。

2024-08-30 13:30 湖北

阿里发布Qwen2-VL,开源了Qwen2-VL-2B和Qwen2-VL-7B,72B型号后续推出,Qwen2-VL是Qwen模型系列中视觉语言模型的最新版本。

模型架构更新:



Agent Benchmarks

SR、GC、TM 和 EM 分别是成功率、目标条件成功、类型匹配和完全匹配的缩写。

Agent Function Call

Qwen2-VL支持函数调用(又称工具调用或工具使用),基于 Qwen-Agent进行示例演示:

import jsonimport urllib.parse
from qwen_agent.llm import get_chat_modelfrom qwen_agent.llm.schema import ContentItem

def image_gen(prompt: str) -> str: prompt = urllib.parse.quote(prompt) image_url = f'https://image.pollinations.ai/prompt/{prompt}' return image_url

def test(): # Config for the model llm_cfg_oai = { # Using Qwen2-VL deployed at any openai-compatible service such as vLLM: 'model_type': 'qwenvl_oai', 'model': 'Qwen/Qwen2-VL-72B-Instruct', 'model_server': 'http://localhost:8000/v1', # api_base 'api_key': 'EMPTY', } llm = get_chat_model(llm_cfg_oai)
# Initial conversation messages = [{ 'role': 'user', 'content': [{ 'image': 'https://dashscope.oss-cn-beijing.aliyuncs.com/images/dog_and_girl.jpeg' }, { 'text': '图片中的内容是什么?请画一张内容相同,风格类似的图片。' }] }]
functions = [ { 'name': 'image_gen', 'description': 'AI绘画(图像生成)服务,输入文本描述,返回根据文本信息绘制的图片URL。', 'parameters': { 'name': 'prompt', 'type': 'string', 'description': '详细描述了希望生成的图像具有什么内容,例如人物、环境、动作等细节描述,使用英文', 'required': True } }, ]
print('# Assistant Response 1:') responses = [] for responses in llm.chat(messages=messages, functions=functions, stream=True): print(responses) messages.extend(responses)
for rsp in responses: if rsp.get('function_call', None): func_name = rsp['function_call']['name'] if func_name == 'image_gen': func_args = json.loads(rsp['function_call']['arguments']) image_url = image_gen(func_args['prompt']) print('# Function Response:') func_rsp = { 'role': 'function', 'name': func_name, 'content': [ContentItem(image=image_url), ContentItem(text=f'( 这张图片的URL是 {image_url} )')], } messages.append(func_rsp) print(func_rsp) else: raise NotImplementedError
print('# Assistant Response 2:') responses = [] for responses in llm.chat(messages=messages, functions=functions, stream=True): print(responses) messages.extend(responses)

if __name__ == '__main__': test()
https://huggingface.co/collections/Qwen/qwen2-vl-66cee7455501d7126940800dhttps://github.com/QwenLM/Qwen2-VL

推荐阅读


欢迎关注我的公众号“PaperAgent”,每天一篇大模型(LLM)文章来锻炼我们的思维,简单的例子,不简单的方法,提升自己。

跳转微信打开

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Qwen2-VL 视觉语言模型 多语言支持 模型架构更新 多模态处理
相关文章