【InternLM 笔记】使用InternStudio 体验书生·浦语2-chat-1.8b随记

书生·浦语2-chat-1.8b

介绍

书生·浦语-1.8B (InternLM2-1.8B) 是第二代浦语模型系列的18亿参数版本。为了方便用户使用和研究,书生·浦语-1.8B (InternLM2-1.8B) 共有三个版本的开源模型,他们分别是:

  • InternLM2-1.8B: 具有高质量和高适应灵活性的基础模型,为下游深度适应提供了良好的起点。
  • InternLM2-Chat-1.8B-SFT:在 InternLM2-1.8B 上进行监督微调 (SFT) 后得到的对话模型。
  • InternLM2-Chat-1.8B:通过在线 RLHF 在 InternLM2-Chat-1.8B-SFT 之上进一步对齐。 InternLM2-Chat-1.8B表现出更好的指令跟随、聊天体验和函数调用,推荐下游应用程序使用。

InternLM2 模型具备以下的技术特点

  • 有效支持20万字超长上下文:模型在20万字长输入中几乎完美地实现长文“大海捞针”,而且在 LongBench 和 L-Eval 等长文任务中的表现也达到开源模型中的领先水平。
  • 综合性能全面提升:各能力维度相比上一代模型全面进步,在推理、数学、代码等方面的能力提升显著。

体验过程

体验使用https://studio.intern-ai.org.cn/进行体验

准备环境

拉取环境

/root/share/install_conda_env_internlm_base.sh internlm-demo  # 执行该脚本文件来安装项目实验环境

激活环境

conda activate internlm-demo

安装运行 demo 所需要的依赖

# 升级pip
python -m pip install --upgrade pippip install modelscope==1.9.5
pip install transformers==4.35.2
pip install streamlit==1.24.0
pip install sentencepiece==0.1.99
pip install accelerate==0.24.1

模型下载

从魔塔社区下载模型
文件名:download_model.py

import torch
from modelscope import snapshot_download, AutoModel, AutoTokenizer
import os
model_dir = snapshot_download('jayhust/internlm2-chat-1_8b', cache_dir='/root/model', revision='master')

模型会下载到/root/model文件夹下,完整路径:/root/model/jayhust/internlm2-chat-1_8b

运行

使用终端体验代码

import torch
from transformers import AutoTokenizer, AutoModelForCausalLMmodel_name_or_path = "/root/model/jayhust/internlm2-chat-1_8b"tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map='auto')
model = model.eval()system_prompt = """You are an AI assistant whose name is InternLM (书生·浦语).
- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.
- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.
"""messages = [(system_prompt, '')]print("=============Welcome to InternLM chatbot, type 'exit' to exit.=============")while True:input_text = input("User  >>> ")input_text = input_text.replace(' ', '')if input_text == "exit":breakresponse, history = model.chat(tokenizer, input_text, history=messages)messages.append((input_text, response))print(f"robot >>> {response}")

运行结果:
在这里插入图片描述

WEB方式运行

cd /root/code
git clone https://gitee.com/internlm/InternLM.git
cd InternLM
git checkout 3028f07cb79e5b1d7342f4ad8d11efad3fd13d17
cd /root/code/InternLM
streamlit run web_demo.py --server.address 127.0.0.1 --server.port 6006

OpenCompass模型评测

准备环境

安装conda环境

conda create --name opencompass --clone=/root/share/conda_envs/internlm-base
conda activate opencompass
git clone https://github.com/open-compass/opencompass
cd opencompass
pip install -e .

安装依赖

pip install protobuf

数据准备

cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/
unzip OpenCompassData-core-20231110.zip

启动评测

python run.py --datasets ceval_gen --hf-path /root/model/jayhust/internlm2-chat-1_8b --tokenizer-path /root/model/jayhust/internlm2-chat-1_8b --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug

评测结果:

20240302_122143
tabulate format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dataset                                         version    metric         mode      opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
----------------------------------------------  ---------  -------------  ------  ------------------------------------------------------------------------
ceval-computer_network                          db9ce2     accuracy       gen                                                                        26.32
ceval-operating_system                          1c2571     accuracy       gen                                                                        36.84
ceval-computer_architecture                     a74dad     accuracy       gen                                                                        14.29
ceval-college_programming                       4ca32a     accuracy       gen                                                                        13.51
ceval-college_physics                           963fa8     accuracy       gen                                                                        36.84
ceval-college_chemistry                         e78857     accuracy       gen                                                                        12.5
ceval-advanced_mathematics                      ce03e2     accuracy       gen                                                                        10.53
ceval-probability_and_statistics                65e812     accuracy       gen                                                                        33.33
ceval-discrete_mathematics                      e894ae     accuracy       gen                                                                        18.75
ceval-electrical_engineer                       ae42b9     accuracy       gen                                                                        27.03
ceval-metrology_engineer                        ee34ea     accuracy       gen                                                                        50
ceval-high_school_mathematics                   1dc5bf     accuracy       gen                                                                         5.56
ceval-high_school_physics                       adf25f     accuracy       gen                                                                        31.58
ceval-high_school_chemistry                     2ed27f     accuracy       gen                                                                        42.11
ceval-high_school_biology                       8e2b9a     accuracy       gen                                                                        15.79
ceval-middle_school_mathematics                 bee8d5     accuracy       gen                                                                        15.79
ceval-middle_school_biology                     86817c     accuracy       gen                                                                        57.14
ceval-middle_school_physics                     8accf6     accuracy       gen                                                                        36.84
ceval-middle_school_chemistry                   167a15     accuracy       gen                                                                        60
ceval-veterinary_medicine                       b4e08d     accuracy       gen                                                                        43.48
ceval-college_economics                         f3f4e6     accuracy       gen                                                                        43.64
ceval-business_administration                   c1614e     accuracy       gen                                                                        36.36
ceval-marxism                                   cf874c     accuracy       gen                                                                        78.95
ceval-mao_zedong_thought                        51c7a4     accuracy       gen                                                                        45.83
ceval-education_science                         591fee     accuracy       gen                                                                        68.97
ceval-teacher_qualification                     4e4ced     accuracy       gen                                                                        68.18
ceval-high_school_politics                      5c0de2     accuracy       gen                                                                        47.37
ceval-high_school_geography                     865461     accuracy       gen                                                                        36.84
ceval-middle_school_politics                    5be3e7     accuracy       gen                                                                        57.14
ceval-middle_school_geography                   8a63be     accuracy       gen                                                                        58.33
ceval-modern_chinese_history                    fc01af     accuracy       gen                                                                        60.87
ceval-ideological_and_moral_cultivation         a2aa4a     accuracy       gen                                                                        68.42
ceval-logic                                     f5b022     accuracy       gen                                                                        31.82
ceval-law                                       a110a1     accuracy       gen                                                                        20.83
ceval-chinese_language_and_literature           0f8b68     accuracy       gen                                                                        17.39
ceval-art_studies                               2a1300     accuracy       gen                                                                        51.52
ceval-professional_tour_guide                   4e673e     accuracy       gen                                                                        62.07
ceval-legal_professional                        ce8787     accuracy       gen                                                                        30.43
ceval-high_school_chinese                       315705     accuracy       gen                                                                        21.05
ceval-high_school_history                       7eb30a     accuracy       gen                                                                        70
ceval-middle_school_history                     48ab4a     accuracy       gen                                                                        72.73
ceval-civil_servant                             87d061     accuracy       gen                                                                        38.3
ceval-sports_science                            70f27b     accuracy       gen                                                                        47.37
ceval-plant_protection                          8941f9     accuracy       gen                                                                        45.45
ceval-basic_medicine                            c409d6     accuracy       gen                                                                        57.89
ceval-clinical_medicine                         49e82d     accuracy       gen                                                                        40.91
ceval-urban_and_rural_planner                   95b885     accuracy       gen                                                                        45.65
ceval-accountant                                002837     accuracy       gen                                                                        38.78
ceval-fire_engineer                             bc23f5     accuracy       gen                                                                        38.71
ceval-environmental_impact_assessment_engineer  c64e2d     accuracy       gen                                                                        38.71
ceval-tax_accountant                            3a5e3c     accuracy       gen                                                                        32.65
ceval-physician                                 6e277d     accuracy       gen                                                                        38.78
ceval-stem                                      -          naive_average  gen                                                                        29.41
ceval-social-science                            -          naive_average  gen                                                                        54.16
ceval-humanities                                -          naive_average  gen                                                                        46.1
ceval-other                                     -          naive_average  gen                                                                        42.11
ceval-hard                                      -          naive_average  gen                                                                        23.9
ceval                                           -          naive_average  gen                                                                        40.39
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-------------------------------------------------------------------------------------------------------------------------------- THIS IS A DIVIDER --------------------------------------------------------------------------------------------------------------------------------csv format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dataset,version,metric,mode,opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
ceval-computer_network,db9ce2,accuracy,gen,26.32
ceval-operating_system,1c2571,accuracy,gen,36.84
ceval-computer_architecture,a74dad,accuracy,gen,14.29
ceval-college_programming,4ca32a,accuracy,gen,13.51
ceval-college_physics,963fa8,accuracy,gen,36.84
ceval-college_chemistry,e78857,accuracy,gen,12.50
ceval-advanced_mathematics,ce03e2,accuracy,gen,10.53
ceval-probability_and_statistics,65e812,accuracy,gen,33.33
ceval-discrete_mathematics,e894ae,accuracy,gen,18.75
ceval-electrical_engineer,ae42b9,accuracy,gen,27.03
ceval-metrology_engineer,ee34ea,accuracy,gen,50.00
ceval-high_school_mathematics,1dc5bf,accuracy,gen,5.56
ceval-high_school_physics,adf25f,accuracy,gen,31.58
ceval-high_school_chemistry,2ed27f,accuracy,gen,42.11
ceval-high_school_biology,8e2b9a,accuracy,gen,15.79
ceval-middle_school_mathematics,bee8d5,accuracy,gen,15.79
ceval-middle_school_biology,86817c,accuracy,gen,57.14
ceval-middle_school_physics,8accf6,accuracy,gen,36.84
ceval-middle_school_chemistry,167a15,accuracy,gen,60.00
ceval-veterinary_medicine,b4e08d,accuracy,gen,43.48
ceval-college_economics,f3f4e6,accuracy,gen,43.64
ceval-business_administration,c1614e,accuracy,gen,36.36
ceval-marxism,cf874c,accuracy,gen,78.95
ceval-mao_zedong_thought,51c7a4,accuracy,gen,45.83
ceval-education_science,591fee,accuracy,gen,68.97
ceval-teacher_qualification,4e4ced,accuracy,gen,68.18
ceval-high_school_politics,5c0de2,accuracy,gen,47.37
ceval-high_school_geography,865461,accuracy,gen,36.84
ceval-middle_school_politics,5be3e7,accuracy,gen,57.14
ceval-middle_school_geography,8a63be,accuracy,gen,58.33
ceval-modern_chinese_history,fc01af,accuracy,gen,60.87
ceval-ideological_and_moral_cultivation,a2aa4a,accuracy,gen,68.42
ceval-logic,f5b022,accuracy,gen,31.82
ceval-law,a110a1,accuracy,gen,20.83
ceval-chinese_language_and_literature,0f8b68,accuracy,gen,17.39
ceval-art_studies,2a1300,accuracy,gen,51.52
ceval-professional_tour_guide,4e673e,accuracy,gen,62.07
ceval-legal_professional,ce8787,accuracy,gen,30.43
ceval-high_school_chinese,315705,accuracy,gen,21.05
ceval-high_school_history,7eb30a,accuracy,gen,70.00
ceval-middle_school_history,48ab4a,accuracy,gen,72.73
ceval-civil_servant,87d061,accuracy,gen,38.30
ceval-sports_science,70f27b,accuracy,gen,47.37
ceval-plant_protection,8941f9,accuracy,gen,45.45
ceval-basic_medicine,c409d6,accuracy,gen,57.89
ceval-clinical_medicine,49e82d,accuracy,gen,40.91
ceval-urban_and_rural_planner,95b885,accuracy,gen,45.65
ceval-accountant,002837,accuracy,gen,38.78
ceval-fire_engineer,bc23f5,accuracy,gen,38.71
ceval-environmental_impact_assessment_engineer,c64e2d,accuracy,gen,38.71
ceval-tax_accountant,3a5e3c,accuracy,gen,32.65
ceval-physician,6e277d,accuracy,gen,38.78
ceval-stem,-,naive_average,gen,29.41
ceval-social-science,-,naive_average,gen,54.16
ceval-humanities,-,naive_average,gen,46.10
ceval-other,-,naive_average,gen,42.11
ceval-hard,-,naive_average,gen,23.90
ceval,-,naive_average,gen,40.39
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-------------------------------------------------------------------------------------------------------------------------------- THIS IS A DIVIDER --------------------------------------------------------------------------------------------------------------------------------raw format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------------
Model: opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
ceval-computer_network: {'accuracy': 26.31578947368421}
ceval-operating_system: {'accuracy': 36.84210526315789}
ceval-computer_architecture: {'accuracy': 14.285714285714285}
ceval-college_programming: {'accuracy': 13.513513513513514}
ceval-college_physics: {'accuracy': 36.84210526315789}
ceval-college_chemistry: {'accuracy': 12.5}
ceval-advanced_mathematics: {'accuracy': 10.526315789473683}
ceval-probability_and_statistics: {'accuracy': 33.33333333333333}
ceval-discrete_mathematics: {'accuracy': 18.75}
ceval-electrical_engineer: {'accuracy': 27.027027027027028}
ceval-metrology_engineer: {'accuracy': 50.0}
ceval-high_school_mathematics: {'accuracy': 5.555555555555555}
ceval-high_school_physics: {'accuracy': 31.57894736842105}
ceval-high_school_chemistry: {'accuracy': 42.10526315789473}
ceval-high_school_biology: {'accuracy': 15.789473684210526}
ceval-middle_school_mathematics: {'accuracy': 15.789473684210526}
ceval-middle_school_biology: {'accuracy': 57.14285714285714}
ceval-middle_school_physics: {'accuracy': 36.84210526315789}
ceval-middle_school_chemistry: {'accuracy': 60.0}
ceval-veterinary_medicine: {'accuracy': 43.47826086956522}
ceval-college_economics: {'accuracy': 43.63636363636363}
ceval-business_administration: {'accuracy': 36.36363636363637}
ceval-marxism: {'accuracy': 78.94736842105263}
ceval-mao_zedong_thought: {'accuracy': 45.83333333333333}
ceval-education_science: {'accuracy': 68.96551724137932}
ceval-teacher_qualification: {'accuracy': 68.18181818181817}
ceval-high_school_politics: {'accuracy': 47.368421052631575}
ceval-high_school_geography: {'accuracy': 36.84210526315789}
ceval-middle_school_politics: {'accuracy': 57.14285714285714}
ceval-middle_school_geography: {'accuracy': 58.333333333333336}
ceval-modern_chinese_history: {'accuracy': 60.86956521739131}
ceval-ideological_and_moral_cultivation: {'accuracy': 68.42105263157895}
ceval-logic: {'accuracy': 31.818181818181817}
ceval-law: {'accuracy': 20.833333333333336}
ceval-chinese_language_and_literature: {'accuracy': 17.391304347826086}
ceval-art_studies: {'accuracy': 51.515151515151516}
ceval-professional_tour_guide: {'accuracy': 62.06896551724138}
ceval-legal_professional: {'accuracy': 30.434782608695656}
ceval-high_school_chinese: {'accuracy': 21.052631578947366}
ceval-high_school_history: {'accuracy': 70.0}
ceval-middle_school_history: {'accuracy': 72.72727272727273}
ceval-civil_servant: {'accuracy': 38.297872340425535}
ceval-sports_science: {'accuracy': 47.368421052631575}
ceval-plant_protection: {'accuracy': 45.45454545454545}
ceval-basic_medicine: {'accuracy': 57.89473684210527}
ceval-clinical_medicine: {'accuracy': 40.909090909090914}
ceval-urban_and_rural_planner: {'accuracy': 45.65217391304348}
ceval-accountant: {'accuracy': 38.775510204081634}
ceval-fire_engineer: {'accuracy': 38.70967741935484}
ceval-environmental_impact_assessment_engineer: {'accuracy': 38.70967741935484}
ceval-tax_accountant: {'accuracy': 32.6530612244898}
ceval-physician: {'accuracy': 38.775510204081634}
ceval-stem: {'naive_average': 29.410892033746723}
ceval-social-science: {'naive_average': 54.161475396956334}
ceval-humanities: {'naive_average': 46.102931026874565}
ceval-other: {'naive_average': 42.10911608938226}
ceval-hard: {'naive_average': 23.89894005847953}
ceval: {'naive_average': 40.387790633140824}
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/725288.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

双指针算法(2)

611.有效三角形的个数 一、题目描述 OJ题目链接:力扣(LeetCode) 二、思路讲解 首先我们能想到的一定是暴力枚举,它的时间复杂度是(O^3)。 我们可以固定一个最长边,然后在比这条边小的有序数组中找出一个二元组&…

八、西瓜书——特征选择与稀疏学习

1.子集搜索与评价 对于1个学习任务来说,给定属性集,其中有些属性可能很关键、很有用,另一些属性则可能没什么用,我们将属性称为“特征”(feature),对当前学习任务有用的属性称为“相关特征”(relevant feature)、没什么用的属性称为“无关特征”(irrelev…

Vue:双token无感刷新

文章目录 初次授权与发放Token:Access Token的作用:Refresh Token的作用:无感刷新:安全机制:后端创建nest项目AppController 添加login、refresh、getinfo接口创建user.dto.tsAppController添加模拟数据 前端Hbuilder创…

Pytest中实现自动生成测试用例脚本代码!

前言 在Python的测试框架中,我们通常会针对某个系统进行测试用例的维护,在对庞大系统进行用例维护时,往往会发现很多测试用例是差不多的,甚至大多数代码是一样的。 故为了提高我们测试用例维护的效率,在本文中&#…

Redis缓存知识总结

图解缓存 what&how problems&strategy 缓存更新 缓存穿透 缓存雪崩 缓存击穿 (图源自黑马教育)

3.5日常学习

matlab处理数据 自己写了关于detect_data的函数,让它帮我改了,哈哈哈 %改正前function data_chuli(path1,savepath)[num]xlsread(path1,1,B18:F23);a num;ba;cb(:);xlswrite(savepath,c) end%改正后function data_chuli(path1, savepath)num xlsread…

100 spring-security 中 /oauth/token 发送请求不携带参数 报错 “401 Unauthorized“

前言 最近存在这样的一个问题, 大致的复现方式是 访问 /oauth/token 接口, 然后不携带任何参数, 结果 服务器抛出了一个 "401 Unauthorized" 针对这个 401, 这里 梳理一下这个流程, 也会衍生出一些其他的问题 测试用例 客户端这边大致的情况是 构造参数, 然后发…

HashMap 源码解读

文章目录 一、什么是HashMap HashMap 是一种快速的查找并且插入、删除性能都良好的一种 K/V键值对的数据结构,key唯一,value允许重复它基于哈希表的 Map 接口实现,是常用的 Java 集合之一,是非线程安全的。 二、HashMap的数据结…

rtt的io设备框架面向对象学习-触摸设备

目录 1.触摸设备基类2.触摸设备基类的子类3.初始化/构造流程3.1设备驱动层3.2 设备驱动框架层3.3 io设备管理层 4.总结5.使用5.1实例 1.触摸设备基类 此层处于设备驱动框架层。此层的类是抽象类。 在/ components / drivers / include / drivers /touch.h定义了如下touch设备…

C语言----冒泡排序进阶

冒泡排序大家应该到写过吧。但大家可能知道到的冒泡排序有两种方法。而我呢,最近学习到了另外一种方法,现在知道三种方法了。所以想与大家分享一下。但是缺点是第三种是第二种的自实现版。第一种就是我们平常写的普通冒泡排序。第二种就是qsort。第三种就…

Matlab梁单元有限元编程 | 铁木辛柯梁 | 欧拉梁 | Matlab源码 | 理论文本

专栏导读 作者简介:工学博士,高级工程师,专注于工业软件算法研究本文已收录于专栏:《有限元编程从入门到精通》本专栏旨在提供 1.以案例的形式讲解各类有限元问题的程序实现,并提供所有案例完整源码;2.单元…

如何恢复edge的自动翻译功能

介绍:对于英文不好的小伙伴,把英语翻译成中文是有帮助的,而edge可以直接对英文页面翻译这一功能更是受人喜爱,但是,最近发现这一项功能消失了。 原始界面: 下面展示如何恢复该功能。 1.打开edge&#xff…

day06-网路编程

#include <myhead.h>int do_add(sqlite3 *ppDb) {int numb;char name[20];int age;int salary;printf("请输入要插入的信息:");scanf("%d %s %d %d", &numb, name, &age, &salary);char sql[128] "";sprintf(sql, "INSE…

Flutter(四):SingleChildScrollView、GridView

SingleChildScrollView、GridView 遇到的问题 以下代码会报错: class GridViewPage extends StatefulWidget {const GridViewPage({super.key});overrideState<GridViewPage> createState() > _GridViewPage(); }class _GridViewPage extends State<GridViewPage&g…

vscode 通义灵码 插件自动写代码

安装插件 通义灵码安装教程-阿里云 点击立即安装 我是已经安装成功了&#xff0c;所以如下图&#xff0c;没安装的会显示安装&#xff0c;点击安装即可 安装成功之后 侧边栏会出现图标 登录 使用 在编辑框中输入 问题 &#xff0c;会自动生成代码和对应的说明

Cloud+Consul

Cloud整合Zookeeper代替Eureka-CSDN博客 Consul简介 Consul是一套开源的分布式服务发现和配置管理系统 What is Consul? | Consul | HashiCorp DeveloperConsul is a service networking solution that delivers service discovery, service mesh, and network security ca…

Redis中的RDB和AOF持久化机制(一)

Redis持久化 RDB快照(snapshot). 在默认情况下&#xff0c;Redis将内存数据库快照保存在名字为dump.rdb的二进制文件中.Redis可以进行设置,让它在"N秒内数据集至少有M个改动"这一条件被满足时&#xff0c;自动保存一次数据集。比如说&#xff0c;以下设置会让Redis…

机器视觉 /从bottle.hdev示例程序开启HalconHDevelop征程

文章目录 概述示例程序bottle.hdev源码Step 0: PreparationsStep 1: Segmentation - 读取并显示图片Step 1: Segmentation - 创建并设置OCR模型Step 1: Segmentation - 文本分割与识别计算结果显示内存释放 导出为C代码导出为C代码配置 VS Halcon 环境VS程序执行结果HTuple hv…

LeetCode刷题---填充每个节点的下一个右侧节点指针

官方题解:LeetCode官方题解 解题思想: 因为是一棵满二叉树&#xff0c;所以除了叶子节点外的其他节点都有两个子节点。 可以根据每一层来依次遍历 从根节点开始&#xff0c;根节点的左子节点的next节点就指向根节点的右子节点 因为根节点的next节点为NULL&#xff0c;开始从根…

DR模式下LVS负载均衡聚集部署实验

目录 1、实验准备 2、配置负载调度器&#xff08;ens33&#xff1a;192.168.80.9 VIP:192.168.80.188&#xff09; 2.1 配置虚拟ip地址&#xff08;VIP&#xff1a;192.168.80.188&#xff09; 2.2 调整proc响应参数 2.3 设置负载分配策略 3、部署共享存储&#xff08;NF…