news 2026/4/23 17:36:38

qwen 系列模型涉及到的部署、推理

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
qwen 系列模型涉及到的部署、推理

来源 https://qwen.readthedocs.io/en/latest/quantization/awq.html

  • 其中关于智能体部分
importos from qwen_agent.agentsimportAssistant# Define LLMllm_cfg={# Use a custom endpoint compatible with OpenAI API by vLLM/SGLang:'model':'Qwen/Qwen3-32B','model_server':'http://localhost:8000/v1',# api_base'api_key':'EMPTY',# 'generate_cfg': {# # When using vLLM/SGLang OAI API, pass the parameter of whether to enable thinking mode in this way# 'extra_body': {# 'chat_template_kwargs': {'enable_thinking': False}# },## # Add: When the content is `<think>this is the thought</think>this is the answer`# # Do not add: When the response has been separated by reasoning_content and content# # This parameter will affect the parsing strategy of tool call# # 'thought_in_content': True,# },}# llm_cfg = {# # Use the model service provided by DashScope:# 'model': 'qwen3-235b-a22b',# 'model_type': 'qwen_dashscope',## # 'generate_cfg': {# # # When using the Dash Scope API, pass the parameter of whether to enable thinking mode in this way# # 'enable_thinking': False,# # },# }# llm_cfg = {# # Use the OpenAI-compatible model service provided by DashScope:# 'model': 'qwen3-235b-a22b',# 'model_server': 'https://dashscope.aliyuncs.com/compatible-mode/v1',# 'api_key': os.getenv('DASHSCOPE_API_KEY'),## # 'generate_cfg': {# # # When using Dash Scope OAI API, pass the parameter of whether to enable thinking mode in this way# # 'extra_body': {# # 'enable_thinking': False# # },# # },# }# Define Toolstools=[{'mcpServers':{# You can specify the MCP configuration file'time':{'command':'uvx','args':['mcp-server-time','--local-timezone=Asia/Shanghai']},"fetch":{"command":"uvx","args":["mcp-server-fetch"]}}},'code_interpreter',# Built-in tools]# Define Agentbot=Assistant(llm=llm_cfg,function_list=tools)# Streaming generationmessages=[{'role':'user','content':'https://qwenlm.github.io/blog/ Introduce the latest developments of Qwen'}]forresponsesinbot.run(messages=messages): pass print(responses)
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/23 9:50:20

<span class=“js_title_inner“>第149篇:基于机器学习的字符N-Gram与 XGBoost模型的DGA恶意域名高效识别方法讲解</span>

Part1 前言 大家好&#xff0c;我是ABC_123。前面几期分享了几篇关于机器学习/深度学习/神经网络学习的文章&#xff0c;没想到自己在2016、2017年时的一些研究&#xff0c;在人工智能备受关注的当下&#xff0c;使得自己还没有掉队。当年在识别DGA域名的任务时&#xff0c;主要…

作者头像 李华
网站建设 2026/4/23 9:45:28

关于Locust的讲解

1. 它是什么Locust 是一个用 Python 编写的开源负载测试工具。它的核心思路是让你用普通的 Python 代码来定义测试用户的行为。你可以把 Locust 想象成一个“虚拟用户生成器”&#xff0c;这些虚拟用户会按照你编写的脚本&#xff0c;去操作你的网站或服务&#xff0c;以此来模…

作者头像 李华
网站建设 2026/4/23 9:47:21

提升仓储管理效率,其实没您想的那么难

对于制造企业而言&#xff0c;仓库从来不是简单的“物料堆放地”&#xff0c;而是串联生产、供应、交付的核心枢纽——仓库作业效率低&#xff0c;会直接导致交货延迟、成本攀升&#xff0c;甚至影响企业口碑&#xff0c;拖累整体发展。很多企业明明投入了人力、物力&#xff0…

作者头像 李华
网站建设 2026/4/22 17:09:44

国产CAD让设计到加工的数据不再“掉链子”

干数控编程十几年&#xff0c;数据格式兼容的坑踩了一遍又一遍。客户那边常甩来UG、Pro/E的模型&#xff0c;以前没别的办法&#xff0c;只能装一堆插件转格式&#xff0c;转完的模型总是缺胳膊少腿的&#xff0c;光核对数据就得耗大半天&#xff0c;返工更是常有的事&#xff…

作者头像 李华
网站建设 2026/4/23 9:45:28

GPU加速在大数据领域的未来发展趋势

GPU加速在大数据领域的未来发展趋势:从算力革命到智能跃迁 标题选项 GPU加速如何重塑大数据未来?深度解析五大趋势与实战案例 大数据处理的下一个十年:GPU加速技术全景展望与落地路径 从“慢处理”到“实时智能”:GPU加速驱动大数据价值重构 算力跃升与架构革新:GPU加速引…

作者头像 李华