LangChain Demo | Agent X ReAct X wikipedia 询问《三体》的主要内容
背景
LangChain学习中,尝试改了一下哈里森和吴恩达课程当中的问题,看看gpt-3.5-turbo在集成了ReAct和wikipedia后,如何回答《三体》的主要内容是什么这个问题,当然,主要是为了回答这问题时LangChain内部发生了什么。所以将langchain.debug 设置为 True。
代码出奇简洁👇
代码
import sys
import os# 添加 parent_dir 到 sys.path
current_dir = os.path.dirname(__file__)
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)from constants import PROXY_URL,KEYimport warnings
warnings.filterwarnings("ignore")import langchain
langchain.debug = Truefrom langchain.agents import load_tools, initialize_agent
from langchain.agents import AgentType
from langchain.python import PythonREPL
from langchain.chat_models import ChatOpenAIllm = ChatOpenAI(temperature=0.0,model_name="gpt-3.5-turbo", openai_api_key=KEY,openai_api_base=PROXY_URL
)tools = load_tools(["wikipedia"],llm=llm
)agent= initialize_agent(tools, #第二步加载的工具llm, #第一步初始化的模型agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION, #代理类型handle_parsing_errors=True, #处理解析错误verbose = True #输出中间步骤
)response = agent("What is the main content of the science fiction novel The Three-Body Problem?")print(response)
输出异常繁琐👇
控制台输出
[chain/start] [1:chain:AgentExecutor] Entering Chain run with input:
{
"input": "What is the main content of the science fiction novel The Three-Body Problem?"
}
[chain/start] [1:chain:AgentExecutor > 2:chain:LLMChain] Entering Chain run with input:
{
"input": "What is the main content of the science fiction novel The Three-Body Problem?",
"agent_scratchpad": "",
"stop": [
"Observation:"
]
}
[llm/start] [1:chain:AgentExecutor > 2:chain:LLMChain > 3:llm:ChatOpenAI]
Entering LLM run with input:
{
"prompts": [
"System: Answer the following questions as best you can. You have access to the following tools:\n\nwikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.\n\nThe way you use the tools is by specifying a json blob.\nSpecifically, this json should have a `action` key (with the name of the tool
to use) and a `action_input` key (with the input to the tool going here).\n\nThe only values that should be in the \"action\" field are: wikipedia\n\nThe $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n\n```\n{\n \"action\": $TOOL_NAME,\n \"action_input\": $INPUT\n}\n```\n\nALWAYS use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction:\n```\n$JSON_BLOB\n```\nObservation: the result of the action\n... (this Thought/Action/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin! Reminder to always use the exact characters `Final Answer` when responding.\nHuman: What is the main content of the science fiction novel The Three-Body Problem?"
]
}
[llm/end] [1:chain:AgentExecutor > 2:chain:LLMChain > 3:llm:ChatOpenAI] [3.96s] Exiting LLM run with output:
{
"generations": [
[
{
"text": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n \"action\": \"wikipedia\",\n \"action_input\": \"The
Three-Body Problem (novel)\"\n}\n```",
"generation_info": {
"finish_reason": "stop",
"logprobs": null
},
"type": "ChatGeneration",
"message": {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
"schema",
"messages",
"AIMessage"
],
"kwargs": {
"content": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n \"action\": \"wikipedia\",\n \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```",
"additional_kwargs": {}
}
}
}
]
],
"llm_output": {
"token_usage": {
"completion_tokens": 55,
"prompt_tokens": 306,
"total_tokens": 361
},
"model_name": "gpt-3.5-turbo",
"system_fingerprint": "fp_3bc1b5746c"
},
"run": null
}
[chain/end] [1:chain:AgentExecutor > 2:chain:LLMChain] [3.96s] Exiting Chain run with output:
{
"text": "Thought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n \"action\": \"wikipedia\",\n \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```"
}
[tool/start] [1:chain:AgentExecutor > 4:tool:wikipedia] Entering Tool run
with input:
"The Three-Body Problem (novel)"
[tool/end] [1:chain:AgentExecutor > 4:tool:wikipedia] [5.47s] Exiting Tool run with output:
"Page: The Three-Body Problem (novel)
Summary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy. The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem in orbital mechanics.
The story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the
Galaxy Award for Chinese science fiction. In 2012, it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That
translation was the first novel by an Asian writer to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production, but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series, 3 Body Problem, was released in March 2024.Page: Three-body problem
Summary: In physics and classical mechanics, the three-body problem is the problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.
Historically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics or quantum mechanics that models the motion of three particles.Page: 3 Body Problem (TV series)
Summary: 3 Body Problem is an American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.
The series premiered on Netflix with its eight episodes on March 21, 2024."
[chain/start] [1:chain:AgentExecutor > 5:chain:LLMChain] Entering Chain run with input:
{
"input": "What is the main content of the science fiction novel The Three-Body Problem?",
"agent_scratchpad": "This was your previous work (but I haven't seen any of it! I only see what you return as final answer):\nThought: I can use Wikipedia to find information about the main content of the science fiction novel \"The Three-Body Problem\".\n\nAction:\n```\n{\n \"action\": \"wikipedia\",\n \"action_input\": \"The Three-Body Problem (novel)\"\n}\n```\nObservation: Page: The Three-Body Problem (novel)\nSummary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy. The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem in orbital mechanics.\nThe story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the Galaxy Award for Chinese science fiction. In 2012, it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That translation was the first novel by an
Asian writer to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production,
but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series,
3 Body Problem, was released in March 2024.\n\nPage: Three-body problem\nSummary: In physics and classical mechanics, the three-body problem is the
problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.\nHistorically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics or quantum mechanics that models the motion of three particles.\n\n\n\nPage: 3 Body Problem (TV series)\nSummary: 3 Body Problem is an
American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese
novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.\nThe series premiered on Netflix with its eight episodes on March 21, 2024.\n\n\nThought:",
"stop": [
"Observation:"
]
}
[llm/start] [1:chain:AgentExecutor > 5:chain:LLMChain > 6:llm:ChatOpenAI]
Entering LLM run with input:
{
"prompts": [
"System: Answer the following questions as best you can. You have access to the following tools:\n\nwikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.\n\nThe way you use the tools is by specifying a json blob.\nSpecifically, this json should have a `action` key (with the name of the tool
to use) and a `action_input` key (with the input to the tool going here).\n\nThe only values that should be in the \"action\" field are: wikipedia\n\nThe $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB:\n\n```\n{\n \"action\": $TOOL_NAME,\n \"action_input\": $INPUT\n}\n```\n\nALWAYS use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction:\n```\n$JSON_BLOB\n```\nObservation: the result of the action\n... (this Thought/Action/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n\nBegin! Reminder to always use the exact characters `Final Answer` when responding.\nHuman: What is the main content of the science fiction novel The Three-Body Problem?\n\nThis was your previous work (but I haven't seen any of it! I only see what you return as final answer):\nThought: I can use Wikipedia to find information about the main content of the science fiction novel \"The
Three-Body Problem\".\n\nAction:\n```\n{\n \"action\": \"wikipedia\",\n
\"action_input\": \"The Three-Body Problem (novel)\"\n}\n```\nObservation: Page: The Three-Body Problem (novel)\nSummary: The Three-Body Problem (Chinese: 三体; lit. 'Three-Body') is a story by Chinese science fiction author Liu Cixin, the first novel in the Remembrance of Earth's Past trilogy.
The series portrays a fictional past, present and future wherein Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another, a representative example of the three-body problem
in orbital mechanics.\nThe story was originally serialized in Science Fiction World in 2006 before it was published as a standalone book in 2008. In 2006, it received the Galaxy Award for Chinese science fiction. In 2012,
it was described as one of China's most successful full-length novels of the past two decades. The English translation by Ken Liu was published by Tor Books in 2014. That translation was the first novel by an Asian writer
to win a Hugo Award for Best Novel; it was also nominated for the Nebula Award for Best Novel.The book has been adapted into other media. In 2015, a Chinese film adaptation of the same name was in production, but it was never released. A Chinese TV series, Three-Body, released in early 2023 to critical success locally. An English language Netflix series, 3 Body Problem, was released in March 2024.\n\nPage: Three-body problem\nSummary: In physics and classical mechanics, the three-body problem is the problem of taking the initial positions and velocities (or momenta) of three point masses and solving for their subsequent motion according to Newton's laws of motion and Newton's law of universal gravitation. The three-body problem is a special case of the n-body problem. Unlike two-body problems, no general closed-form solution exists, as the resulting dynamical system is chaotic for most initial conditions, and numerical methods are generally required.\nHistorically, the first specific three-body problem to receive extended study was the one involving the Moon, Earth, and the Sun. In an extended modern sense, a three-body problem is any problem in classical mechanics
or quantum mechanics that models the motion of three particles.\n\n\n\nPage: 3 Body Problem (TV series)\nSummary: 3 Body Problem is an American science fiction television series created by David Benioff, D. B. Weiss and Alexander Woo, loosely based on the Hugo Award-winning Chinese novel The Three-Body Problem by Liu Cixin. It is the second live-action adaptation after the 2023 Chinese television series.\nThe series premiered on Netflix with its eight episodes on March 21, 2024.\n\n\nThought:"
]
}
[llm/end] [1:chain:AgentExecutor > 5:chain:LLMChain > 6:llm:ChatOpenAI] [4.10s] Exiting LLM run with output:
{
"generations": [
[
{
"text": "I have found information about the main content of the science fiction novel \"The Three-Body Problem\" by Liu Cixin. It is a story that portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.",
"generation_info": {
"finish_reason": "stop",
"logprobs": null
},
"type": "ChatGeneration",
"message": {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
"schema",
"messages",
"AIMessage"
],
"kwargs": {
"content": "I have found information about the main content of the science fiction novel \"The Three-Body Problem\" by Liu Cixin. It is
a story that portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.",
"additional_kwargs": {}
}
}
}
]
],
"llm_output": {
"token_usage": {
"completion_tokens": 113,
"prompt_tokens": 924,
"total_tokens": 1037
},
"model_name": "gpt-3.5-turbo",
"system_fingerprint": "fp_3bc1b5746c"
},
"run": null
}
[chain/end] [1:chain:AgentExecutor > 5:chain:LLMChain] [4.10s] Exiting Chain run with output:
{
"text": "I have found information about the main content of the science
fiction novel \"The Three-Body Problem\" by Liu Cixin. It is a story that
portrays a fictional past, present, and future where Earth encounters an alien civilization from a nearby system of three sun-like stars orbiting one another. The novel is the first in the Remembrance of Earth's Past trilogy and has received critical acclaim.\n\nFinal Answer: The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars."
}
[chain/end] [1:chain:AgentExecutor] [13.57s] Exiting Chain run with output:
{
"output": "The main content of the science fiction novel \"The Three-Body Problem\" involves Earth encountering an alien civilization from a nearby system of three sun-like stars."
}
{'input': 'What is the main content of the science fiction novel The Three-Body Problem?', 'output': 'The main content of the science fiction novel
"The Three-Body Problem" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.'}
最终结果
The Three-Body Problem" involves Earth encountering an alien civilization from a nearby system of three sun-like stars.
翻译:《三体问题》涉及地球遇到来自附近三颗类太阳恒星系统的外星文明。
相关文章:
LangChain Demo | Agent X ReAct X wikipedia 询问《三体》的主要内容
背景 LangChain学习中,尝试改了一下哈里森和吴恩达课程当中的问题,看看gpt-3.5-turbo在集成了ReAct和wikipedia后,如何回答《三体》的主要内容是什么这个问题,当然,主要是为了回答这问题时LangChain内部发生了什么。所…...
Revit 2025新功能一览~
Hello大家好!我是九哥~ Revit2025已经更新,安装后,简单试了下,还是挺不错的,流畅度啊,新功能啊,看来还是有听取用户意见的,接下来就简单看看都有哪些新功能。 好了,今天的…...
Head First Design Patterns -代理模式
什么是代理模式 代理模式为另一个对象提供替身或者占位符,以便控制客户对对象的访问,管理访问的方式有很多种。例如远程代理、虚拟代理、保护代理等。 远程代理:管理客户和远程对象之间的交互。 虚拟代理:控制访问实例化开销大的对…...
第十三题:天干地支
题目描述 古代中国使用天干地支来记录当前的年份。 天干一共有十个,分别为:甲(jiǎ)、乙(yǐ)、丙(bǐng)、丁(dīng)、戊(w)、己&a…...
8000预算可以购买阿里云服务器配置整理
一个月8000元预算如何选择阿里云服务器配置?八千预算可选的阿里云服务器配置相当高了,这个预算可以购买阿里云企业级独享型云服务器,至少8核以上的配置,这个预算可以支持复杂、高负载或大规模的业务需求。阿里云服务器网整理8000元…...
游戏APP如何提高广告变现收益的同时,保证用户留存率?
APP广告变现对接第三方聚合广告平台主要通过SDK文档对接,一些媒体APP不具备专业运营广告变现的对接能力和资源沉淀,导致APP被封控,设置列入黑名单,借助第三方聚合广告平台进行商业化变现是最佳选择。#APP广告变现# 接入第三方平台…...
Linux ulimit命令教程:如何查看和设置系统资源限制(附实例详解和注意事项)
Linux ulimit命令介绍 ulimit是一个内置的Linux shell命令,它允许查看或限制单个用户可以消耗的系统资源量。在有多个用户和系统性能问题的环境中,限制资源使用是非常有价值的。 Linux ulimit命令适用的Linux版本 ulimit命令在所有主流的Linux发行版中…...
(delphi11最新学习资料) Object Pascal 学习笔记---第8章第5节(封闭类和Final方法)
8.5.2 封闭类和Final方法 如前所述,Java 采用非常动态的方法,默认情况下采用延迟绑定(或虚函数)。因此,Java 语言引入了一些概念,如不能继承的类(封闭类)和不能在派生类中覆盖的方法…...
vue3从精通到入门12:vue3的生命周期和组件
生命周期: 生命周期钩子主要包括: beforeCreate:组件实例被创建之前调用。在这个阶段,组件的 props 和 data 还未被初始化。created:组件实例创建完成后调用。在这个阶段,组件的 props 和 data 已经被初始…...
力扣热题100_链表_21_合并两个有序链表
文章目录 题目链接解题思路解题代码 题目链接 21. 合并两个有序链表 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1: 输入:l1 [1,2,4], l2 [1,3,4] 输出:[1,1,2,3,4,4] 示例…...
探索未来智慧酒店网项目接口架构
在数字化时代,智慧酒店已成为酒店业发展的重要趋势之一。智慧酒店网项目接口架构作为支撑智慧酒店运营的核心技术之一,其设计和优化对于提升用户体验、提高管理效率具有重要意义。本文将深入探讨智慧酒店网项目接口架构的设计理念和关键要素。 ### 智慧…...
os模块篇(十三)
文章目录 os.mknod(path, mode0o600, device0, *, dir_fdNone)os.major(device, /)os.minor(device, /)os.makedev(major, minor, /)os.pathconf(path, name)os.readlink(path, *, dir_fdNone)os.remove(path, *, dir_fdNone)os.removedirs(name)os.rename(src, dst, *, src_di…...
【JavaEE初阶系列】——文件操作 IO 之 文件系统操作
目录 📝认识文件 🚩树型结构组织 和 目录 🎈绝对路径和相对路径 🚩文件类型 📝文件系统操作 🎈File 概述 🎈File类的使用 1. 绝对路径 vs 相对路径 2. 路径分隔符 3. 静态成员变量 4…...
JAVA 学习·类与方法
不同于 C ,Java 是一门面向对象的编程语言。C 也有面向对象的内容,但是 C 和 Java 在方法的具体实现上存在区别。 方法的定义 方法(method)是为执行一个复杂操作组合在一起的语句集合。一个类中可以声明多个方法。其语法是采用 BNF 范式(Bac…...
4. python练习题4-水仙花数
4. python练习题4-水仙花数 【目录】 文章目录 4. python练习题4-水仙花数1. 目标任务2. 水仙花数的特点3. 如何判断一个数是否是水仙花数?4. 打印3位水仙花数5. 判断一个数是不是水仙花数6. 列表推导式6. 列表推导式判断一个数是不是水仙花数 【正文】 1. 目标任务…...
【Qt 学习笔记】Qt 开发环境的搭建 | Qt 安装教程
博客主页:Duck Bro 博客主页系列专栏:Qt 专栏关注博主,后期持续更新系列文章如果有错误感谢请大家批评指出,及时修改感谢大家点赞👍收藏⭐评论✍ Qt 开发环境的搭建 | Qt 安装教程 文章编号:Qt 学习笔记 /…...
ids工业相机与电控位移台同步控制及数据采集
通过VS2017和OpenCV,实现ids工业相机与电控位移台同步控制及数据采集 目录项目环境配置代码流程及思路项目架构项目开发运行效果开发关键ids相机配置位移台环境配置相机头文件相机参数设置保存图像函数设置电控位移台头文件电控位移台设置参数最后就是通过main函数进行调用和控…...
景联文科技提供高质量医疗健康AI大模型数据
医疗行业是典型的知识和技术密集型行业,其发展水平直接关系到国民健康和生命质量。 医疗健康AI大模型,作为人工智能的一个分支,能够通过学习大量的数据来生成新的数据实例,在医药研发、医学影像、医疗文本分析等都有广泛的应用前景…...
【Python第三方库】lxml 解析器和xpath路径语言
1.lxml是做什么的 是xml/html的解析器,主要是用来解析和提取html/xml数据 2.lxml语法 使用etree.HTML(html字符串),将字符串转换为Element对象通过使用Element对象.xpath(语法)提取信息,返回的是一个列表的内存地址,需要通过使用索引获取信…...
Java(Lambda、集合)、题解
一、Lambda表达式 标准格式 ()对应方法的形参 ;->固定格式 注意点: Lambda表达式可以用来简化匿名内部类的书写 Lambda表达式只能简化函数式接口的匿名内部类的写法 函数式接口: 有且仅有一个抽象方法的接口叫做函数式接口&…...
网络六边形受到攻击
大家读完觉得有帮助记得关注和点赞!!! 抽象 现代智能交通系统 (ITS) 的一个关键要求是能够以安全、可靠和匿名的方式从互联车辆和移动设备收集地理参考数据。Nexagon 协议建立在 IETF 定位器/ID 分离协议 (…...
谷歌浏览器插件
项目中有时候会用到插件 sync-cookie-extension1.0.0:开发环境同步测试 cookie 至 localhost,便于本地请求服务携带 cookie 参考地址:https://juejin.cn/post/7139354571712757767 里面有源码下载下来,加在到扩展即可使用FeHelp…...
内存分配函数malloc kmalloc vmalloc
内存分配函数malloc kmalloc vmalloc malloc实现步骤: 1)请求大小调整:首先,malloc 需要调整用户请求的大小,以适应内部数据结构(例如,可能需要存储额外的元数据)。通常,这包括对齐调整,确保分配的内存地址满足特定硬件要求(如对齐到8字节或16字节边界)。 2)空闲…...
DeepSeek 赋能智慧能源:微电网优化调度的智能革新路径
目录 一、智慧能源微电网优化调度概述1.1 智慧能源微电网概念1.2 优化调度的重要性1.3 目前面临的挑战 二、DeepSeek 技术探秘2.1 DeepSeek 技术原理2.2 DeepSeek 独特优势2.3 DeepSeek 在 AI 领域地位 三、DeepSeek 在微电网优化调度中的应用剖析3.1 数据处理与分析3.2 预测与…...
STM32标准库-DMA直接存储器存取
文章目录 一、DMA1.1简介1.2存储器映像1.3DMA框图1.4DMA基本结构1.5DMA请求1.6数据宽度与对齐1.7数据转运DMA1.8ADC扫描模式DMA 二、数据转运DMA2.1接线图2.2代码2.3相关API 一、DMA 1.1简介 DMA(Direct Memory Access)直接存储器存取 DMA可以提供外设…...
在WSL2的Ubuntu镜像中安装Docker
Docker官网链接: https://docs.docker.com/engine/install/ubuntu/ 1、运行以下命令卸载所有冲突的软件包: for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done2、设置Docker…...
OPENCV形态学基础之二腐蚀
一.腐蚀的原理 (图1) 数学表达式:dst(x,y) erode(src(x,y)) min(x,y)src(xx,yy) 腐蚀也是图像形态学的基本功能之一,腐蚀跟膨胀属于反向操作,膨胀是把图像图像变大,而腐蚀就是把图像变小。腐蚀后的图像变小变暗淡。 腐蚀…...
听写流程自动化实践,轻量级教育辅助
随着智能教育工具的发展,越来越多的传统学习方式正在被数字化、自动化所优化。听写作为语文、英语等学科中重要的基础训练形式,也迎来了更高效的解决方案。 这是一款轻量但功能强大的听写辅助工具。它是基于本地词库与可选在线语音引擎构建,…...
九天毕昇深度学习平台 | 如何安装库?
pip install 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple --user 举个例子: 报错 ModuleNotFoundError: No module named torch 那么我需要安装 torch pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple --user pip install 库名&#x…...
Go语言多线程问题
打印零与奇偶数(leetcode 1116) 方法1:使用互斥锁和条件变量 package mainimport ("fmt""sync" )type ZeroEvenOdd struct {n intzeroMutex sync.MutexevenMutex sync.MutexoddMutex sync.Mutexcurrent int…...
