当前位置: 首页 > news >正文

[LLM-Agent]万字长文深度解析规划框架:HuggingGPT

HuggingGPT是一个结合了ChatGPT和Hugging Face平台上的各种专家模型,以解决复杂的AI任务,可以认为他是一种结合任务规划和工具调用两种Agent工作流的框架。它的工作流程主要分为以下几个步骤:

  • 任务规划:使用ChatGPT分析用户的请求,理解他们的意图,并将其分解为可能可解决的任务。
  • 模型选择:为了完成规划的任务,ChatGPT根据模型的描述选择托管在Hugging Face上的专家模型。
  • 任务执行:调用并执行每个选定的模型,然后将结果返回给ChatGPT。
  • 响应生成:最后,使用ChatGPT整合所有模型的预测结果,并生成响应。

图 1

光说不练假把式,我们先尝试运行,然后逐步分析各个阶段的Prompt设计和代码设计。

1. 运行

下载Repo git clone https://github.com/microsoft/JARVIS.git

1.1 安装依赖

安装server依赖

bash
复制代码
cd JARVIS/hugginggpt/server
conda create -n jarvis python=3.8
conda activate jarvis
pip install -r requirements.txt

安装前端页面

bash
复制代码
cd ../web
npm install

注意,requirment.txt中的的werkzeug要更新为Werkzeug==2.2.2,否则Flask会报不兼容问题。这里没有安装pytorch之类的,因为我们不打算在本地下载模型,所需空间过于巨大,直接访问线上的模型。

1.2 修改配置

既然需要在线使用HuggingGPT的模型,那么我们需要到HuggingGPT上申请Token。修改server/configs/config.lite.yaml,更新huggingface token。另外我们要使用本地的LLM模型,需要修改openai->api_key,必须添加sk开头的字符串,不然报错。必须添加local->endpoint, 就是你本地openai的地址。此外,你可能还要修改是否采用续写use_completion和模型。如果无法访问HuggingGPT你还需要添加proxy。

yaml
复制代码
openai: api_key: sk-xxxx # added
huggingface:token: hf_xxx # updated
dev: true
debug: false
log_file: logs/debug.log
model: gpt-3.5-turbo # updated
use_completion: false # updated
inference_mode: huggingface # local, huggingface or hybrid, prefer hybrid
local_deployment: minimal # minimal, standard or full, prefer full
num_candidate_models: 5
max_description_length: 100
proxy: http://127.0.0.1:7890 # optional: your proxy server "http://ip:port"
local:endpoint: http://localhost:11434 # updated
...

此外,还需要修改server/awsome_chat.py,添加API_KEY否则也无法运行本地LLM。

python
复制代码
if API_TYPE == "local":API_ENDPOINT = f"{config['local']['endpoint']}/v1/{api_name}"
+    API_KEY = config['openai']['api_key']

1.2 运行

开始运行

bash
复制代码
python  --config configs/config.lite.yaml --mode server
npm run dev

然后我们打开浏览器http://localhost:9999/#/, 出现类似下图的窗口。

image-20240524101621504

输入类似

describe the image /examples/c.jpg.

其中examples位于是hugginggpt/server/public/examples/,所以如果你要测试自己的图片,可以考虑将图片放在这儿。会输出类似如下图的结果。

image-20240524102326517

2. 分析

在文章开头我们有说过,任务是分为规划任务、选择模型、执行任务和生成响应。那么我们先从任务规划看起。

2.1 任务规划

任务规划需要LLM进行推理分解任务,对于这样一个将HuggingFace当做调用工具的框架,我们要如何设计Prompt?几个原则

  1. 说明任务
  2. 说明任务的输入输出
  3. Few-Shot示例
  4. 上下文
  5. 用户输入

此外,我们还需要将HuggingFace所包含的API给到LLM,进行推理用户问题所需任务步骤。我们当然不可能将所有HuggingFace上的Model都提供给LLM,所以我们提供任务类型,huggingface上大约有19个任务类型, 其中15个NLP任务类型,2个Audio任务类型,3个CV的任务类型。

我觉得这里通过任务类型缩小LLM选择工具选择范围,之后再通过任务类型,然后再让LLM选择具体的模型,相当于一种摘要技术,从大类选择,在缩小到具体选择。你要知道hugginggpt在p0_models.jsonl中缓存了大约673个任务,你不可能将他们所有的描述都发送给LLM,它包含2765000个字符。

说明任务,在输出上对LLM有强烈的要求,除了要求是JSON,而且要求推理各个任务的依赖关系,并且填充类似的JSON输出。然而我要说的这种复杂的输出要求,当前只能用于Demo,否则你会遇到非常多的解析,无法获得想要的JSON格式,或者丢失特定的字段

json
复制代码
The AI assistant can parse user input to several tasks: [{"task": task, "id": task_id, "dep": dependency_task_id, "args": {"text": text or <GENERATED>-dep_id, "image": image_url or <GENERATED>-dep_id, "audio": audio_url or <GENERATED>-dep_id}}]. 

说明任务的输入和输出,除了上文说的解释任务依赖关系和如何生成tasks之外,这里设定了task必须是HuggingFace支持的这些类别,args必须是text、imag和audio。还是老话,要求越多失败越多,我就遇到args偶尔缺失,task偶尔不对的问题。

json
复制代码
The special tag "<GENERATED>-dep_id" refer to the one generated text/image/audio in the dependency task (Please consider whether the dependency task generates resources of this type.) and "dep_id" must be in "dep" list. The "dep" field denotes the ids of the previous prerequisite tasks which generate a new resource that the current task relies on. The "args" field must in ["text", "image", "audio"], nothing else. The task MUST be selected from the following options: "token-classification", "text2text-generation", "summarization", "translation", "question-answering", "conversational", "text-generation", "sentence-similarity", "tabular-classification", "object-detection", "image-classification", "image-to-image", "image-to-text", "text-to-image", "text-to-video", "visual-question-answering", "document-question-answering", "image-segmentation", "depth-estimation", "text-to-speech", "automatic-speech-recognition", "audio-to-audio", "audio-classification", "canny-control", "hed-control", "mlsd-control", "normal-control", "openpose-control", "canny-text-to-image", "depth-text-to-image", "hed-text-to-image", "mlsd-text-to-image", "normal-text-to-image", "openpose-text-to-image", "seg-text-to-image". 

让LLM推理规划,这里有个魔法Think step by step

bash
复制代码
There may be multiple tasks of the same type. Think step by step about all the tasks needed to resolve the user's request. Parse out as few tasks as possible while ensuring that the user request can be resolved. Pay attention to the dependencies and order among tasks. If the user input can't be parsed, you need to reply empty JSON [], otherwise you must return JSON directly.

设定Few shot examples,大约有6个,考虑阅读体验,这里只放一个,更多的Few shot examples位于hugginggpt/server/demos/demo_parse_task.json

json
复制代码
[{"role": "user","content": "Give you some pictures e1.jpg, e2.png, e3.jpg, help me count the number of sheep?"},{"role": "assistant","content": "[{"task": "image-to-text", "id": 0, "dep": [-1], "args": {"image": "e1.jpg" }}, {"task": "object-detection", "id": 1, "dep": [-1], "args": {"image": "e1.jpg" }}, {"task": "visual-question-answering", "id": 2, "dep": [1], "args": {"image": "<GENERATED>-1", "text": "How many sheep in the picture"}} }}, {"task": "image-to-text", "id": 3, "dep": [-1], "args": {"image": "e2.png" }}, {"task": "object-detection", "id": 4, "dep": [-1], "args": {"image": "e2.png" }}, {"task": "visual-question-answering", "id": 5, "dep": [4], "args": {"image": "<GENERATED>-4", "text": "How many sheep in the picture"}} }}, {"task": "image-to-text", "id": 6, "dep": [-1], "args": {"image": "e3.jpg" }},  {"task": "object-detection", "id": 7, "dep": [-1], "args": {"image": "e3.jpg" }}, {"task": "visual-question-answering", "id": 8, "dep": [7], "args": {"image": "<GENERATED>-7", "text": "How many sheep in the picture"}}]"},...
]

最后上下文和用户输入,没什么好说的

json
复制代码
The chat log [ {{context}} ] may contain the resources I mentioned. Now I input { {{input}} }. Pay attention to the input and output types of tasks and the dependencies between tasks.

任务规划阶段的Promt就已经结束了,代码实现上这一段较为简单,核心流程是chat->chat_huggingface->parse_task->send_request。其中parse_task负责组装prompt和构造open ai API所需的data参数。这里有一个简易的对话上下文移动窗口,就是计算历史对话文本的tokens,如果超过最大token就尝试pop掉最后一个,这是移除最近的对话记录保留开始的策略,当然你也可以尝试其他策略。

python
复制代码# cut chat logsstart = 0while start <= len(context):history = context[start:]prompt = replace_slot(parse_task_prompt, {"input": input,"context": history })messages.append({"role": "user", "content": prompt})history_text = "<im_end>\nuser<im_start>".join([m["content"] for m in messages])num = count_tokens(LLM_encoding, history_text)if get_max_context_length(LLM) - num > 800:breakmessages.pop()start += 2

2.2 模型选择

在上文parse_task完成后,在chat_huggingface中就会对返回的结果进行任务解析,此时由于LLM回复的不确定性,有时候你会遇到失败无法解析或者丢失字段,一个成功的任务会返回类似如下的JSON。

json
复制代码
[{'task': 'object-detection', 'id': 0, 'dep': [-1], 'args': {'image': '/examples/a.jpg'}}, {'task': 'image-to-image', 'id': 1, 'dep': [-1], 'args': {'image': '/examples/a.jpg'}}
]

根据task信息,在run_task中根据task值去hugginggpt/server/data/p0_models.jsonl这个json中去搜索前10的具体模型,最后根据类型查找到可用模型如下。

python
复制代码
{'local': [], 'huggingface': ['hustvl/yolos-tiny', 'microsoft/table-transformer-structure-recognition', 'facebook/detr-resnet-50', 'TahaDouaji/detr-doc-table-detection', 'hustvl/yolos-small']}

这里在选择模型时候,需要修改一下代码否则你几乎获取不到任何一个可用模型。

进入函数choose_model再次构造Prompt,让LLM帮助决策哪个模型更好, 以下prompt只是示意,因为源代码将其转换为了role content组成的arraylist。

vbnet
复制代码
System: Given the user request and the parsed tasks, the AI assistant helps the user to select a suitable model from a list of models to process the user request. The assistant should focus more on the description of the model and find the model that has the most potential to solve requests and tasks. Also, prefer models with local inference endpoints for speed and stability. 
[
User: {{input}},
Assistant: {{task}}..
]
User: Please choose the most suitable model from {{metas}} for the task {{task}}. The output must be in a strict JSON format: {"id": "id", "reason": "your detail reasons for the choice"}, the id in JSON must be the one provided in the model description.

输出如下,已经给出了最佳的模型和原因,接下来进入模型执行。

json
复制代码
{"id": "facebook/detr-resnet-50", "reason": "The model has the highest number of likes, and the description sounds promising with end-to-end detection using transformers. Also, it has a local inference endpoint for faster access."}

2.3 模型执行

上面模型已经选择,输入也有,接下来就是执行模型,这一步比较简单,就是构造huggingface api的请求。

python
复制代码
inference_result = model_inference(best_model_id, args, hosted_on, command['task'])

HuggingFace API的请求较为简单,只要你拥有Token,你甚至可以通过curl直接运行。

kotlin
复制代码
curl --location 'https://api-inference.huggingface.co/models/facebook/detr-resnet-50-panoptic' \
--header 'Authorization: Bearer replacewithyourowntoken' \
--header 'Content-Type: image/jpeg' \
--data '@/Users/xxxx/dc579d59_track_0.jpg'

由于可能包含多个任务,所以任务是通过thread并发执行的,最后通过queue进行收取结果如下所示。

python
复制代码
{'generated image': '/images/a59b.jpg', 'predicted': [{'score': 0.9699670672416687, 'label': 'potted plant', 'box': {'xmin': 0, 'ymin': 240, 'xmax': 187, 'ymax': 484}}, {'score': 0.9995023012161255, 'label': 'cat', 'box': {'xmin': 165, 'ymin': 59, 'xmax': 645, 'ymax': 522}}]}
DEBUG:__main__:{1: {'task': {'task': 'image-to-image', 'id': 1, 'dep': [-1], 'args': {'image': 'public//examples/a.jpg'}}, 'inference result': {'error': 'Model lambdalabs/sd-image-variations-diffusers is currently loading', 'estimated_time': 248.20472717285156}, 'choose model result': {'id': 'lambdalabs/sd-image-variations-diffusers', 'reason': "The model has the most likes and it's also the only model with the tag 'stable-diffusion', which indicates it's a robust and popular choice for various image tasks."}}, 0: {'task': {'task': 'object-detection', 'id': 0, 'dep': [-1], 'args': {'image': 'public//examples/a.jpg'}}, 'inference result': {'generated image': '/images/a59b.jpg', 'predicted': [{'score': 0.9699670672416687, 'label': 'potted plant', 'box': {'xmin': 0, 'ymin': 240, 'xmax': 187, 'ymax': 484}}, {'score': 0.9995023012161255, 'label': 'cat', 'box': {'xmin': 165, 'ymin': 59, 'xmax': 645, 'ymax': 522}}]}, 'choose model result': {'id': 'facebook/detr-resnet-50', 'reason': 'The model has the highest number of likes, and the description sounds promising with end-to-end detection using transformers. Also, it has a local inference endpoint for faster access.'}}}

2.4 响应生成

在chat_huggingface中调用response_results,给定input和收集的results来构造类似如下所示的Prompt,其中processes就是上文模型执行的结果。该prompt先给定输入的问题和模型执行的结果,然后要求LLM仔细甄别输出的推测结果和问题是否匹配,然后进行作答。最后要求输出的它的工作流,包括使用的模型和推测结果和生成的文件位置等信息。

vbscript
复制代码
System: #4 Response Generation Stage: With the task execution logs, the AI assistant needs to describe the process and inference results.
User: Look at /examples/a.jpg picture, can you tell me how many objects in the picture? Give me a picture similar to this one.
Assitant: Before give you a response, I want to introduce my workflow for your request, which is shown in the following JSON data: {{processes}}. Do you have any demands regarding my response?
User: Yes. Please first think carefully and directly answer my request based on the inference results. Some of the inferences may not always turn out to be correct and require you to make careful consideration in making decisions. Then please detail your workflow including the used models and inference results for my request in your friendly tone. Please filter out information that is not relevant to my request. Tell me the complete path or urls of files in inference results. If there is nothing in the results, please tell me you can't make it.

最终LLM输入如下响应

json
复制代码
Sure! Based on the inference results, there are two objects in the picture "/examples/a.jpg". They are a potted plant and a cat.
For your second request, after reviewing the available options, I've selected a similar image using a model with the ID "facebook/detr-resnet-50". This model identified a similar image with the path: "/images/a59b.jpg".
The workflow goes like this:
1. Object Detection: I used a model called "facebook/detr-resnet-50" to detect objects in your image. It's an end-to-end model that uses transformers and has shown great performance. It successfully identified two objects for us.
2. Image Similarity: To find a similar image, I picked another pre-trained model called "lambdalabs/sd-image-variations-diffusers". This model is known to create variations of input images while keeping the main content stable. It's a diffusion-based model, and these types of models are good at generating new content with preserving the essence of the original image. 
However, I need to let you know that getting the similar image didn't work this time. The inference took longer than expected, which is not uncommon for some complex models, and eventually timed out. So, unfortunately, I couldn't generate a similar image within the given constraints.
I hope this helps! Let me know if you'd like more details on any specific steps or have additional questions.

3. 总结

纵观整个流程其实主要还是Prompt的设计,如何设计更好的Prompt生成任务规划、模型选择和响应生成。在这种中间就是各种结果的解析工作,以及调用各种工具完成任务。值得一说的是,我在实验过程中,遇到各种各样的错误,尤其是第一阶段的任务规划中的任务输出,它对LLM的要求非常高,如果你只是本地的小模型或许是难以胜任的。第二,当你有很多工具选择,不妨将他们先进行分类,让LLM先从分类中选择,然后筛选出缩小后具体的工具列表,再次给到LLM选择最优最匹配的工具

如何系统的去学习大模型LLM ?

作为一名热心肠的互联网老兵,我意识到有很多经验和知识值得分享给大家,也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑,所以在工作繁忙的情况下还是坚持各种整理和分享。

但苦于知识传播途径有限,很多互联网行业朋友无法获得正确的资料得到学习提升,故此将并将重要的 AI大模型资料 包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来

😝有需要的小伙伴,可以V扫描下方二维码免费领取🆓

在这里插入图片描述

一、全套AGI大模型学习路线

AI大模型时代的学习之旅:从基础到前沿,掌握人工智能的核心技能!

img

二、640套AI大模型报告合集

这套包含640份报告的合集,涵盖了AI大模型的理论研究、技术实现、行业应用等多个方面。无论您是科研人员、工程师,还是对AI大模型感兴趣的爱好者,这套报告合集都将为您提供宝贵的信息和启示。

img

三、AI大模型经典PDF籍

随着人工智能技术的飞速发展,AI大模型已经成为了当今科技领域的一大热点。这些大型预训练模型,如GPT-3、BERT、XLNet等,以其强大的语言理解和生成能力,正在改变我们对人工智能的认识。 那以下这些PDF籍就是非常不错的学习资源。

img

在这里插入图片描述

四、AI大模型商业化落地方案

img

阶段1:AI大模型时代的基础理解

  • 目标:了解AI大模型的基本概念、发展历程和核心原理。
  • 内容
    • L1.1 人工智能简述与大模型起源
    • L1.2 大模型与通用人工智能
    • L1.3 GPT模型的发展历程
    • L1.4 模型工程
      - L1.4.1 知识大模型
      - L1.4.2 生产大模型
      - L1.4.3 模型工程方法论
      - L1.4.4 模型工程实践
    • L1.5 GPT应用案例

阶段2:AI大模型API应用开发工程

  • 目标:掌握AI大模型API的使用和开发,以及相关的编程技能。
  • 内容
    • L2.1 API接口
      - L2.1.1 OpenAI API接口
      - L2.1.2 Python接口接入
      - L2.1.3 BOT工具类框架
      - L2.1.4 代码示例
    • L2.2 Prompt框架
      - L2.2.1 什么是Prompt
      - L2.2.2 Prompt框架应用现状
      - L2.2.3 基于GPTAS的Prompt框架
      - L2.2.4 Prompt框架与Thought
      - L2.2.5 Prompt框架与提示词
    • L2.3 流水线工程
      - L2.3.1 流水线工程的概念
      - L2.3.2 流水线工程的优点
      - L2.3.3 流水线工程的应用
    • L2.4 总结与展望

阶段3:AI大模型应用架构实践

  • 目标:深入理解AI大模型的应用架构,并能够进行私有化部署。
  • 内容
    • L3.1 Agent模型框架
      - L3.1.1 Agent模型框架的设计理念
      - L3.1.2 Agent模型框架的核心组件
      - L3.1.3 Agent模型框架的实现细节
    • L3.2 MetaGPT
      - L3.2.1 MetaGPT的基本概念
      - L3.2.2 MetaGPT的工作原理
      - L3.2.3 MetaGPT的应用场景
    • L3.3 ChatGLM
      - L3.3.1 ChatGLM的特点
      - L3.3.2 ChatGLM的开发环境
      - L3.3.3 ChatGLM的使用示例
    • L3.4 LLAMA
      - L3.4.1 LLAMA的特点
      - L3.4.2 LLAMA的开发环境
      - L3.4.3 LLAMA的使用示例
    • L3.5 其他大模型介绍

阶段4:AI大模型私有化部署

  • 目标:掌握多种AI大模型的私有化部署,包括多模态和特定领域模型。
  • 内容
    • L4.1 模型私有化部署概述
    • L4.2 模型私有化部署的关键技术
    • L4.3 模型私有化部署的实施步骤
    • L4.4 模型私有化部署的应用场景

学习计划:

  • 阶段1:1-2个月,建立AI大模型的基础知识体系。
  • 阶段2:2-3个月,专注于API应用开发能力的提升。
  • 阶段3:3-4个月,深入实践AI大模型的应用架构和私有化部署。
  • 阶段4:4-5个月,专注于高级模型的应用和部署。
这份完整版的大模型 LLM 学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

😝有需要的小伙伴,可以Vx扫描下方二维码免费领取🆓

在这里插入图片描述

相关文章:

[LLM-Agent]万字长文深度解析规划框架:HuggingGPT

HuggingGPT是一个结合了ChatGPT和Hugging Face平台上的各种专家模型&#xff0c;以解决复杂的AI任务&#xff0c;可以认为他是一种结合任务规划和工具调用两种Agent工作流的框架。它的工作流程主要分为以下几个步骤&#xff1a; 任务规划&#xff1a;使用ChatGPT分析用户的请求…...

二十三篇:未来数据库革新:AI与云原生的融合之旅

未来数据库革新&#xff1a;AI与云原生的融合之旅 1. 智能数据库管理&#xff1a;AI的魔法 在数字化时代&#xff0c;数据库技术作为信息管理的核心&#xff0c;正经历着前所未有的变革。AI&#xff08;人工智能&#xff09;和云原生技术的融合&#xff0c;正在重新定义数据库…...

彩光赋能中国智造 极简光3.X助力“数智”转型

蒸汽时代、电气时代、信息时代三大工业革命后 互联网和智能制造主导的工业4.0时代来临 大数据、云计算、人工智能等新兴技术 对企业园区的网络架构、负载能力等 提出了新要求,也使得光纤较于传统铜缆 在距离、性能、延时上的优势日益凸显 基于此 围绕未来园区网建设的企…...

985上交应届生转正12天,被某东辞退了!

&#x1f447;我的小册 45章教程:(小白零基础用Python量化股票分析小册) ,原价299&#xff0c;限时特价2杯咖啡&#xff0c;满100人涨10元。 01.事情起源 最近粉丝群都在转发一个截图&#xff0c;某应届毕业生在某东实习一年&#xff0c;才转正才12天&#xff0c;就因为自己调侃…...

Unity算法(一)——快速排序算法

文章目录 前言快速排序算法1、概念与实现2、优化 前言 算法是程序员的基础能力之一&#xff0c;资质越老的程序员在这方面理解会越深&#xff0c;很多时候项目在某个需要优化、提升的节点时&#xff0c;往往一些算法的使用就可以大大提升程序性能。当然&#xff0c;对于不同项…...

Leetcode 2028

思路&#xff1a;1-6之间的的n个数组合起来要变成sum_t mean*(rolls.size()n) - sum(rolls) ; 那么可以先假设每个数都是sum_t / n 其中这个数必须要在1 - 6 之间否者无法分配。 然后可以得出n * (sum_t / n ) < sum ; 需要对余数mod进行调整&#xff0c;为了减少调整的次…...

Angular(1):使用Angular CLI创建空项目

要创建一个空的 Angular 项目&#xff0c;可以使用 Angular CLI&#xff08;命令行界面&#xff09;。以下是使用 Angular CLI 创建一个新项目的步骤&#xff1a; 1、安装 Angular CLI&#xff1a; 打开你的命令行界面&#xff08;在 Windows 上是 CMD、PowerShell 或 Git Bas…...

字节跳动(校招)算法原题

大模型"价格战"越演越烈 昨天的 文章 提到&#xff0c;自从 5 月 15 号&#xff0c;字节跳动发布了击穿行业底价的豆包大模型后&#xff0c;各大厂家纷纷跟进降价&#xff0c;而且都不是普通降价&#xff0c;要么降价 90% 以上&#xff0c;要么直接免费。 今天是豆包…...

前端面试题日常练-day39 【面试题】

题目 希望这些选择题能够帮助您进行前端面试的准备&#xff0c;答案在文末。 1. 哪个jQuery方法用于设置元素的HTML内容&#xff1f; a) .html() b) .text() c) .val() d) .append() 2. 在jQuery中&#xff0c;以下哪个方法用于隐藏或显示一个元素&#xff1f; a) .toggle…...

心电信号降噪方法(滤波器/移动平均/小波等,MATLAB环境)

对于一个正常的、完整的心动周期&#xff0c;对应的心电图波形如下图所示&#xff0c;各个波形都对应着心脏兴奋活动的生理过程&#xff0c;包含P波&#xff0c;PR段&#xff0c;QRS波群&#xff0c;ST段&#xff0c;T波&#xff0c;U波。 &#xff08;1&#xff09;P波心电图中…...

Kubernetes 文档 / 概念 / 工作负载 / 管理工作负载

Kubernetes 文档 / 概念 / 工作负载 / 管理工作负载 此文档从 Kubernetes 官网摘录 中文地址 英文地址 你已经部署了你的应用并且通过 Service 将其暴露出来。现在要做什么&#xff1f; Kubernetes 提供了一系列的工具帮助你管理应用的部署&#xff0c;包括扩缩和更新。 组织…...

【第6章】SpringBoot整合Mybatis

文章目录 前言一、准备1. 版本要求2.安装3. 建表语句 二、案例1. mapper2.实体类3.测试类4.扫描5. 配置6. mapper.xml7.输出 总结 前言 MyBatis-Spring-Boot-Starter 可以帮助你更快地在 Spring Boot 之上构建 MyBatis 应用。 一、准备 1. 版本要求 MyBatis-Spring-Boot-Sta…...

vim常用指令——001

vim常用指令 Vim的命令模式常用操作一、定位移动光标二、行的基本操作【复制、粘贴、删除】三、查找、替换四、分屏命令 总结给大家总结下四个运行模式&#xff1a; Vim的命令模式常用操作 一、定位移动光标 按h&#xff1a;将光标向左移动一个字符&#xff0c;等同于方向键左…...

java 对接农行支付相关业务(二)

文章目录 农行掌银集成第三方APP1:掌银支付对接快e通的流程1.1 在农行网站上注册我们的app信息([网址](https://openbank.abchina.com/Portal/index/index.html))1.2:java整合农行的jar包依赖1.3:把相关配置信息整合到项目中1.4:前端获取授权码信息1.5:后端根据授权码信…...

超频是什么意思?超频的好处和坏处

你是否曾经听说过超频&#xff1f;在电脑爱好者的圈子里&#xff0c;这个词似乎非常熟悉&#xff0c;但对很多普通用户来说&#xff0c;它可能还是一个神秘而陌生的存在。 电脑超频是什么意思 电脑超频&#xff08;Overclocking&#xff09;&#xff0c;顾名思义&#xff0c;是…...

【cocos creator】进度条控制脚本,支持节点进度条,图片进度条,进度条组件,和进度文字展示

进度条控制脚本&#xff0c;支持节点进度条&#xff0c;图片进度条&#xff0c;进度条组件&#xff0c;和进度文字展示 const { ccclass, property, menu } cc._decorator;let text_type cc.Enum({"20%": 0,"1/5": 1,"差值": 2,"自定义…...

Bean的一些属性信息总结

我们知道&#xff0c;在Spring中&#xff0c;一个Bean可以理解为一个对象&#xff0c;但是二者之间肯定是有区别的&#xff0c;比如一个Bean可以实例化成很多个对象、Bean中可以带有某些描述信息。 学习Bean&#xff0c;能更好地使用Bean。 1、Spring两个核心概念的由来【可忽…...

CentOS 7 安装 Minio

获取MinIO安装包 下载地址如下&#xff1a;下载地址通过以下命令可直接将安装包下载至服务器 wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20230809233022.0.0.x86_64.rpm安装MinIO rpm -ivh minio-20230809233022.0.0.x86_64.rpm集成Systemd …...

vue3和vite实现vue-router4版本路由的配置以及自动生成路由配置

这个是普通的手动路由配置&#xff1a;https://blog.csdn.net/weixin_68658847/article/details/130071101 自动路由配置 创建项目 npm create vitelatest my-vue-app -- --template vue // 或者 yarn create vite my-vue-app --template vue// 安装路由 yarn add vue-route…...

Flutter 中的 CupertinoDatePicker 小部件:全面指南

Flutter 中的 CupertinoDatePicker 小部件&#xff1a;全面指南 在 Flutter 中&#xff0c;CupertinoDatePicker 是 Cupertino 组件库的一部分&#xff0c;它提供了一个 iOS 风格的日期选择器。这个选择器允许用户选择日期和时间&#xff0c;非常适合需要符合 iOS 设计指南的应…...

用 Python 编写自动发送每日电子邮件报告的脚本

第一步&#xff1a;安装必要的库 你需要安装 smtplib&#xff08;Python 自带&#xff09;&#xff0c;但你需要安装 schedule 和 email 库。你可以使用以下命令安装这些库&#xff1a; pip install schedule第二步&#xff1a;编写发送邮件的脚本 这里是一个完整的 Python …...

IT人的拖延——渴望成功与害怕成功的矛盾

很多人都以为&#xff0c;害怕失败是拖延的主要诱因&#xff0c;但其实“害怕成功”也是拖延的主要诱因之一。要说这个原因&#xff0c;我们不得不提起Bible中的一个人“约拿”&#xff0c;让我们先来看看他的故事带给我们什么启示。 约拿情结简介 约拿是Bible中的一名先知&a…...

【全开源】场馆预定系统源码(ThinkPHP+FastAdmin+UniApp)

一款基于ThinkPHPFastAdminUniApp开发的多场馆场地预定小程序&#xff0c;提供运动场馆运营解决方案&#xff0c;适用于体育馆、羽毛球馆、兵乒球馆、篮球馆、网球馆等场馆。 场馆预定系统源码&#xff1a;打造高效便捷的预定体验 一、引言&#xff1a;数字化预定时代的来临 …...

音乐系统java在线音乐网站基于springboot+vue的音乐系统带万字文档

文章目录 音乐系统一、项目演示二、项目介绍三、万字项目文档四、部分功能截图五、部分代码展示六、底部获取项目源码和万字论文参考&#xff08;9.9&#xffe5;带走&#xff09; 音乐系统 一、项目演示 在线音乐系统 二、项目介绍 基于springbootvue的前后端分离在线音乐系…...

Python—面向对象小解(1)

一、面向对象 面向对象编程&#xff08;Object-Oriented Programming&#xff0c;简称 OOP&#xff09;是一种程序设计范式&#xff0c;它通过使用“对象”和“类”来组织代码。Python 是一种面向对象的编程语言&#xff0c;支持 OOP 的核心概念。 面向过程&#xff1a…...

2024最新TikTok抖音国际版,tiktok正版免拔卡安装来了!

保姆级教程&#xff01;2024最新TikTok抖音国际版&#xff0c;无限制&#xff01;tiktok正版免拔卡安装方法来了&#xff01; TikTok这款APP为何让全球都为之疯狂&#xff1f;因为它更懂人性&#xff0c;懂的人都懂&#xff01; 我是你的老朋友阿星&#xff0c;今天阿星要给大…...

【Python-OS】os.path.splitext()

作用&#xff1a;将文件路径分割成文件名和扩展名两部分。 slide_id, _ os.path.splitext(slide) print("slide:") print(slide) print("slide_id:") print(slide_id)注&#xff1a; slide是文件名&#xff0c;可以自行赋值...

安卓开发--安卓使用Echatrs绘制折线图

安卓开发--安卓使用Echatrs绘制折线图 前期资料安卓使用Echarts绘制折线图1.1 下载 Echarts 安卓资源1.2 新建assets文件1.3 新建布局文件1.4 在布局文件中布局WebView1.5 在活动文件中调用 最终效果 前期资料 Echarts 官网样式预览: https://echarts.apache.org/examples/zh/…...

每日5题Day9 - LeetCode 41 - 45

每一步向前都是向自己的梦想更近一步&#xff0c;坚持不懈&#xff0c;勇往直前&#xff01; 第一题&#xff1a;41. 缺失的第一个正数 - 力扣&#xff08;LeetCode&#xff09; 今天这道题没有ac&#xff0c;写不动了&#xff0c;下次再通过吧&#xff0c;先给个半成品下次回…...

进程间通信的方式中,socket和消息队列的区别

进程间通信的方式中&#xff0c;socket和消息队列的区别 进程间通信方式中&#xff0c;socket和消息队列的主要区别在于通信的方式和跨机通信的能力。 socket是通过网络传输的方式来实现进程间通信&#xff0c;并且可以跨主机&#xff1b;而消息队列是通过内核提供的缓冲区进…...