Bert-vits2-v2.2新版本本地训练推理整合包(原神八重神子英文模型miko)

在这里插入图片描述

近日,Bert-vits2-v2.2如约更新,该新版本v2.2主要把Emotion 模型换用CLAP多模态模型,推理支持输入text prompt提示词和audio prompt提示语音来进行引导风格化合成,让推理音色更具情感特色,并且推出了新的预处理webuI,操作上更加亲民和接地气。

更多情报请参见Bert-vits2官网:

https://github.com/fishaudio/Bert-VITS2/releases/tag/v2.2

与此同时,基于FastApi的推理web界面项目也同步适配了Bert-vits2-v2.2版本,官网如下:

https://github.com/jiangyuxiaoxiao/Bert-VITS2-UI

本次我们基于此两个项目来克隆原神角色八重神子的英文语音模型miko。

Bert-vits2-v2.2新的底模和情感模型

首先克隆Bert-vits2-v2.2官方项目:

git clone https://github.com/fishaudio/Bert-VITS2/tree/v2.2

安装依赖:

pip3 install -r requirements.txt

这里注意是v2.2的tag分支,因为官方随时都在更新,主分支可能会存在bug。

进入项目的目录:

cd /Bert-VITS2

随后下载新的底模和情感模型,下载地址:

https://openi.pcl.ac.cn/Stardust_minus/Bert-VITS2/modelmanage/show_model

将新的情感模型clap-hatsat-fused放入到项目的emotional目录,结构如下:

E:\work\Bert-VITS2-v22\emotional>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
├───clap-htsat-fused  
│       .gitattributes  
│       config.json  
│       merges.txt  
│       preprocessor_config.json  
│       pytorch_model.bin  
│       README.md  
│       special_tokens_map.json  
│       tokenizer.json  
│       tokenizer_config.json  
│       vocab.json  
│  
└───wav2vec2-large-robust-12-ft-emotion-msp-dim  .gitattributes  config.json  LICENSE  preprocessor_config.json  pytorch_model.bin  README.md  vocab.json

注意,wav2vec2-large-robust-12-ft-emotion-msp-dim是Bert-vits2-v2.1的情感模型,也需要保留,具体请移步:义无反顾马督工,Bert-vits2V210复刻马督工实践(Python3.10), 这里不再赘述。

至此,新模型就配置好了。

Bert-vits2-v2.2模型训练

首先下载训练集,以原神角色八重神子的英文配音为例子,数据集下载地址:

https://github.com/AI-Hobbyist/Genshin_Datasets

随后新建miko角色目录

mkdir miko

将语音标注文件以esd.list命名,放入miko目录。

同时将分片语音素材放入raw目录。

最后新建miko/configs/config.json配置文件:

{  "train": {  "log_interval": 50,  "eval_interval": 50,  "seed": 42,  "epochs": 1000,  "learning_rate": 0.0002,  "betas": [  0.8,  0.99  ],  "eps": 1e-09,  "batch_size": 6,  "fp16_run": false,  "lr_decay": 0.99995,  "segment_size": 16384,  "init_lr_ratio": 1,  "warmup_epochs": 0,  "c_mel": 45,  "c_kl": 1.0,  "skip_optimizer": false,  "freeze_ZH_bert": false,  "freeze_JP_bert": false,  "freeze_EN_bert": false  },  "data": {  "training_files": "data/miko/train.list",  "validation_files": "data/miko/val.list",  "max_wav_value": 32768.0,  "sampling_rate": 44100,  "filter_length": 2048,  "hop_length": 512,  "win_length": 2048,  "n_mel_channels": 128,  "mel_fmin": 0.0,  "mel_fmax": null,  "add_blank": true,  "n_speakers": 1,  "cleaned_text": true,  "spk2id": {  "miko": 0  }  },  "model": {  "use_spk_conditioned_encoder": true,  "use_noise_scaled_mas": true,  "use_mel_posterior_encoder": false,  "use_duration_discriminator": true,  "inter_channels": 192,  "hidden_channels": 192,  "filter_channels": 768,  "n_heads": 2,  "n_layers": 6,  "kernel_size": 3,  "p_dropout": 0.1,  "resblock": "1",  "resblock_kernel_sizes": [  3,  7,  11  ],  "resblock_dilation_sizes": [  [  1,  3,  5  ],  [  1,  3,  5  ],  [  1,  3,  5  ]  ],  "upsample_rates": [  8,  8,  2,  2,  2  ],  "upsample_initial_channel": 512,  "upsample_kernel_sizes": [  16,  16,  8,  2,  2  ],  "n_layers_q": 3,  "use_spectral_norm": false,  "gin_channels": 256  },  "version": "2.2"  
}

这里注意"version": “2.2”,即版本号为最新的v2.2。

其他参数根据当前的设备环境酌情调整即可。

随后启动预处理页面:

python3 webui_preprocess.py

访问http://127.0.0.1:7860/:

按照页面的步骤进行操作即可,简单且方便。

操作完之后,运行训练命令:

python3 train_ms.py

训练好的模型放在data/miko/models目录,结构如下:

E:\work\Bert-VITS2-v22\Data\miko\models>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
│   DUR_0.pth  
│   DUR_100.pth  
│   DUR_150.pth  
│   DUR_50.pth  
│   D_0.pth  
│   D_100.pth  
│   D_150.pth  
│   D_50.pth  
│   events.out.tfevents.1702457087.ly.13044.0  
│   events.out.tfevents.1702458207.ly.12416.0  
│   githash  
│   G_0.pth  
│   G_100.pth  
│   G_150.pth  
│   G_50.pth  
│   train.log  
│  
└───eval  events.out.tfevents.1702457087.ly.13044.1  events.out.tfevents.1702458207.ly.12416.1

至此,训练环节结束。

Bert-vits2-v2.2模型推理

推理我们使用Bert-vits2-UI项目的页面,克隆web项目:

git clone https://github.com/jiangyuxiaoxiao/Bert-VITS2-UI

将Web项目放入Bert-vits2-v2.2的根目录中,目录结构如下:

E:\work\Bert-VITS2-v22_lilith\Web>tree /f  
Folder PATH listing for volume myssd  
Volume serial number is 7CE3-15AE  
E:.  
│   index.html  
│  
├───assets  
│       index-21bc6a28.css  
│       index-402c0217.js  
│  
└───img  helps1.png  helps2.png  Hiyori.ico

这里包含主页面、样式文件以及JS文件,基于Hiyori。

随后启动推理页面:

python3 server_fastapi.py

访问:http://127.0.0.1:5000/:

加载模型进行推理即可。

此外,还可以基于FastAPI的接口进行推理,换句话说,发送http请求即可获取推理音频,接口参数如下:

{  "openapi": "3.1.0",  "info": {  "title": "FastAPI",  "version": "0.1.0"  },  "paths": {  "/": {  "get": {  "summary": "Index",  "operationId": "index__get",  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  }  }  }  },  "/voice": {  "post": {  "summary": "Voice",  "description": "语音接口,若需要上传参考音频请仅使用post请求",  "operationId": "voice_voice_post",  "parameters": [  {  "name": "model_id",  "in": "query",  "required": true,  "schema": {  "type": "integer",  "description": "模型ID",  "title": "Model Id"  },  "description": "模型ID"  },  {  "name": "speaker_name",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "说话人名",  "title": "Speaker Name"  },  "description": "说话人名"  },  {  "name": "speaker_id",  "in": "query",  "required": false,  "schema": {  "type": "integer",  "description": "说话人id,与speaker_name二选一",  "title": "Speaker Id"  },  "description": "说话人id,与speaker_name二选一"  },  {  "name": "sdp_ratio",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "SDP/DP混合比",  "default": 0.2,  "title": "Sdp Ratio"  },  "description": "SDP/DP混合比"  },  {  "name": "noise",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "感情",  "default": 0.2,  "title": "Noise"  },  "description": "感情"  },  {  "name": "noisew",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "音素长度",  "default": 0.9,  "title": "Noisew"  },  "description": "音素长度"  },  {  "name": "length",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "语速",  "default": 1,  "title": "Length"  },  "description": "语速"  },  {  "name": "language",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "语言",  "title": "Language"  },  "description": "语言"  },  {  "name": "auto_translate",  "in": "query",  "required": false,  "schema": {  "type": "boolean",  "description": "自动翻译",  "default": false,  "title": "Auto Translate"  },  "description": "自动翻译"  },  {  "name": "auto_split",  "in": "query",  "required": false,  "schema": {  "type": "boolean",  "description": "自动切分",  "default": false,  "title": "Auto Split"  },  "description": "自动切分"  },  {  "name": "emotion",  "in": "query",  "required": false,  "schema": {  "anyOf": [  {  "type": "integer"  },  {  "type": "string"  },  {  "type": "null"  }  ],  "description": "emo",  "title": "Emotion"  },  "description": "emo"  }  ],  "requestBody": {  "required": true,  "content": {  "multipart/form-data": {  "schema": {  "$ref": "#/components/schemas/Body_voice_voice_post"  }  }  }  },  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  },  "get": {  "summary": "Voice",  "description": "语音接口",  "operationId": "voice_voice_get",  "parameters": [  {  "name": "text",  "in": "query",  "required": true,  "schema": {  "type": "string",  "description": "输入文字",  "title": "Text"  },  "description": "输入文字"  },  {  "name": "model_id",  "in": "query",  "required": true,  "schema": {  "type": "integer",  "description": "模型ID",  "title": "Model Id"  },  "description": "模型ID"  },  {  "name": "speaker_name",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "说话人名",  "title": "Speaker Name"  },  "description": "说话人名"  },  {  "name": "speaker_id",  "in": "query",  "required": false,  "schema": {  "type": "integer",  "description": "说话人id,与speaker_name二选一",  "title": "Speaker Id"  },  "description": "说话人id,与speaker_name二选一"  },  {  "name": "sdp_ratio",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "SDP/DP混合比",  "default": 0.2,  "title": "Sdp Ratio"  },  "description": "SDP/DP混合比"  },  {  "name": "noise",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "感情",  "default": 0.2,  "title": "Noise"  },  "description": "感情"  },  {  "name": "noisew",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "音素长度",  "default": 0.9,  "title": "Noisew"  },  "description": "音素长度"  },  {  "name": "length",  "in": "query",  "required": false,  "schema": {  "type": "number",  "description": "语速",  "default": 1,  "title": "Length"  },  "description": "语速"  },  {  "name": "language",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "语言",  "title": "Language"  },  "description": "语言"  },  {  "name": "auto_translate",  "in": "query",  "required": false,  "schema": {  "type": "boolean",  "description": "自动翻译",  "default": false,  "title": "Auto Translate"  },  "description": "自动翻译"  },  {  "name": "auto_split",  "in": "query",  "required": false,  "schema": {  "type": "boolean",  "description": "自动切分",  "default": false,  "title": "Auto Split"  },  "description": "自动切分"  },  {  "name": "emotion",  "in": "query",  "required": false,  "schema": {  "anyOf": [  {  "type": "integer"  },  {  "type": "string"  },  {  "type": "null"  }  ],  "description": "emo",  "title": "Emotion"  },  "description": "emo"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/models/info": {  "get": {  "summary": "Get Loaded Models Info",  "description": "获取已加载模型信息",  "operationId": "get_loaded_models_info_models_info_get",  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  }  }  }  },  "/models/delete": {  "get": {  "summary": "Delete Model",  "description": "删除指定模型",  "operationId": "delete_model_models_delete_get",  "parameters": [  {  "name": "model_id",  "in": "query",  "required": true,  "schema": {  "type": "integer",  "description": "删除模型id",  "title": "Model Id"  },  "description": "删除模型id"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/models/add": {  "get": {  "summary": "Add Model",  "description": "添加指定模型:允许重复添加相同路径模型,且不重复占用内存",  "operationId": "add_model_models_add_get",  "parameters": [  {  "name": "model_path",  "in": "query",  "required": true,  "schema": {  "type": "string",  "description": "添加模型路径",  "title": "Model Path"  },  "description": "添加模型路径"  },  {  "name": "config_path",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "添加模型配置文件路径,不填则使用./config.json或../config.json",  "title": "Config Path"  },  "description": "添加模型配置文件路径,不填则使用./config.json或../config.json"  },  {  "name": "device",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "推理使用设备",  "default": "cuda",  "title": "Device"  },  "description": "推理使用设备"  },  {  "name": "language",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "模型默认语言",  "default": "ZH",  "title": "Language"  },  "description": "模型默认语言"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/models/get_unloaded": {  "get": {  "summary": "Get Unloaded Models Info",  "description": "获取未加载模型",  "operationId": "get_unloaded_models_info_models_get_unloaded_get",  "parameters": [  {  "name": "root_dir",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "搜索根目录",  "default": "Data",  "title": "Root Dir"  },  "description": "搜索根目录"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/models/get_local": {  "get": {  "summary": "Get Local Models Info",  "description": "获取全部本地模型",  "operationId": "get_local_models_info_models_get_local_get",  "parameters": [  {  "name": "root_dir",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "搜索根目录",  "default": "Data",  "title": "Root Dir"  },  "description": "搜索根目录"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/status": {  "get": {  "summary": "Get Status",  "description": "获取电脑运行状态",  "operationId": "get_status_status_get",  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  }  }  }  },  "/tools/translate": {  "get": {  "summary": "Translate",  "description": "翻译",  "operationId": "translate_tools_translate_get",  "parameters": [  {  "name": "texts",  "in": "query",  "required": true,  "schema": {  "type": "string",  "description": "待翻译文本",  "title": "Texts"  },  "description": "待翻译文本"  },  {  "name": "to_language",  "in": "query",  "required": true,  "schema": {  "type": "string",  "description": "翻译目标语言",  "title": "To Language"  },  "description": "翻译目标语言"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/tools/random_example": {  "get": {  "summary": "Random Example",  "description": "获取一个随机音频+文本,用于对比,音频会从本地目录随机选择。",  "operationId": "random_example_tools_random_example_get",  "parameters": [  {  "name": "language",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "指定语言,未指定则随机返回",  "title": "Language"  },  "description": "指定语言,未指定则随机返回"  },  {  "name": "root_dir",  "in": "query",  "required": false,  "schema": {  "type": "string",  "description": "搜索根目录",  "default": "Data",  "title": "Root Dir"  },  "description": "搜索根目录"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  },  "/tools/get_audio": {  "get": {  "summary": "Get Audio",  "operationId": "get_audio_tools_get_audio_get",  "parameters": [  {  "name": "path",  "in": "query",  "required": true,  "schema": {  "type": "string",  "description": "本地音频路径",  "title": "Path"  },  "description": "本地音频路径"  }  ],  "responses": {  "200": {  "description": "Successful Response",  "content": {  "application/json": {  "schema": {}  }  }  },  "422": {  "description": "Validation Error",  "content": {  "application/json": {  "schema": {  "$ref": "#/components/schemas/HTTPValidationError"  }  }  }  }  }  }  }  },  "components": {  "schemas": {  "Body_voice_voice_post": {  "properties": {  "text": {  "type": "string",  "title": "Text"  },  "reference_audio": {  "type": "string",  "format": "binary",  "title": "Reference Audio"  }  },  "type": "object",  "required": [  "text"  ],  "title": "Body_voice_voice_post"  },  "HTTPValidationError": {  "properties": {  "detail": {  "items": {  "$ref": "#/components/schemas/ValidationError"  },  "type": "array",  "title": "Detail"  }  },  "type": "object",  "title": "HTTPValidationError"  },  "ValidationError": {  "properties": {  "loc": {  "items": {  "anyOf": [  {  "type": "string"  },  {  "type": "integer"  }  ]  },  "type": "array",  "title": "Location"  },  "msg": {  "type": "string",  "title": "Message"  },  "type": {  "type": "string",  "title": "Error Type"  }  },  "type": "object",  "required": [  "loc",  "msg",  "type"  ],  "title": "ValidationError"  }  }  }  
}

最后奉上Bert-vits2-v2.2本地训练推理整合包:

https://pan.baidu.com/s/1OVX9seRwZR6bZ-xsE_nRLg?pwd=v3uc

与众乡亲同飨。

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

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

相关文章

SpringMVC---详细介绍+使用

文章目录 什么是SpringMVC?使用SpringMVCSpringMVC创建和连接创建连接RequestMapping的基础使用 获取参数返回数据返回静态页面返回非页面的普通数据(text/html)返回JSON对象请求转发或者请求重定向 什么是SpringMVC? SpringMVC它…

【Spring】14 ApplicationEventPublisherAware 接口

文章目录 1. 简介2. 作用3. 使用3.1 创建并实现接口3.2 配置 Bean 信息3.3 创建启动类3.4 启动3.5 工作流程图 4. 应用场景总结 Spring 框架为开发者提供了丰富的扩展点,其中之一是 Bean 生命周期中的回调接口。本文将专注介绍一个与事件发布相关的接口 Applicatio…

【SQLite】SQLite数据库简单使用与Navicat安装-加密

Sqlite为免安装数据库,安装步骤总结: 官网下载Sqlit数据库,官网下载地址:https://www.sqlite.org/download.html 下载: sqlite-dll-win64-x64-3390400.zip或者32位sqlite-dll-win32 sqlite-tools-win-x64-3440200.zip或者32位sqlite-tools-wi…

Opencv入门五 (显示图片灰度值)

源码如下&#xff1a; #include <opencv2/opencv.hpp> int main(int argc, char** argv) { cv::Mat img_rgb, img_gry, img_cny; cv::namedWindow("Example Gray",cv::WINDOW_AUTOSIZE); cv::namedWindow("Example Canny", cv::WINDOW_…

若依vue前端 报错error:0308010C:digital envelope routines::unsupported一步到胃的解决方法

第一步: 直接打开package.json 第二步: 直接替换scripts的内容为下面的内容 "scripts": {"dev": "SET NODE_OPTIONS--openssl-legacy-provider && vue-cli-service serve","build:prod": "SET NODE_OPTIONS--openssl-leg…

无源晶振电路中两端电阻和电容的作用

无源晶振电路中两端电阻和电容的作用是什么&#xff0c;今天晶发电子就详细讲讲&#xff0c;具体如下&#xff1a; 一、并联电阻的作用 配合IC内部电路组成负反馈、移相&#xff0c;使放大器工作在线性区。 并联降低谐振阻抗&#xff0c;使无源晶振易启动。 并联电阻取值大小…

【vCenter Converter】VMware vCenter Converter Standalone 理论, 下载与安装要求

目录 1. vCenter Converter 概述1.1 作用与特征&#xff08;1&#xff09;性能和可靠性&#xff08;2&#xff09;互操作性&#xff08;3&#xff09;管理 2. 下载 vCenter Converter Standalone3. 安装 vCenter Converter Standalone3.1 系统要求&#xff08;1&#xff09;支持…

文件消失但是有占用内存的恢复方法

文件消失但占用内存是一个常见的问题&#xff0c;通常是由于文件系统错误或病毒攻击引起的。在这种情况下&#xff0c;文件虽然从目录结构中消失&#xff0c;但它们仍然占用存储空间。本文将分析这一问题的原因&#xff0c;并探讨解决该问题的几种方法。 文件消失但占用内存的原…

android11-开机自启脚本

1. 编写myshell脚本 diff --git a/device/rockchip/rk356x/ok3568_r/myshell.sh b/device/rockchip/rk356x/ok3568_r/myshell.sh new file mode 100644 index 0000000000..c78b6d93bd --- /dev/nullb/device/rockchip/rk356x/ok3568_r/myshell.sh-0,0 1,4 #!/vendor/bin/shec…

抢先看!Salesforce Spring ‘24中的10个亮点功能!

Spring 24来临在即&#xff0c;Preview Orgs已上线。在Spring 24中&#xff0c;将会为管理员、开发人员和顾问带来更多新功能。在这片云计算的海洋里&#xff0c;一些亮点功能总能在Salesforce生态系统中引起强烈反响。本篇文章为学习者们盘点了Spring 24中的10个亮点功能&…

Vue项目搭建过程

Vue项目搭建过程 1、安装NodeJs 1.1 下载安装包 在 http://nodejs.cn/download/ 上下载64位安装包&#xff0c;然后进行安装&#xff0c;和普通软件的安装一样。 C:\Users\Administrator>node -v v16.13.1C:\Users\Administrator>npm -v 8.5.51.2 安装cnpm # 安装cn…

C语言,数组循环哪家好,指针or下标?

日常工作中&#xff0c;我们经常会用到循环遍历数组元素。不考虑只能使用某一特定方式的情况下&#xff0c;有人喜欢用数组下标遍历&#xff0c;有人则喜欢用指针遍历。那么这两者是否有性能差异呢&#xff1f; 我们先来看两个例子&#xff1a; 代码一 /* a.c */ #include &…

【QML】QML复制文件或文件夹,显示进度,多线程复制

1. 效果 可以显示复制文件和文件夹的进度 复制文件&#xff1a; bool copyFileFunc(QString _from, QString _to);复制文件夹&#xff1a;bool copyDirectoryFiles(const QString &_from, const QString &_to);举例&#xff1a; //复制文件copyhelper.copyFileToDir(&…

推荐12款好用的在线平面设计工具,让设计更简单

平面设计是图形表达和信息展示的重要手段&#xff0c;在游戏场景和角色造型、插画、广告制作等艺术设计领域有着重要的应用&#xff0c;如海报设计、包装设计等。 平面设计强调视觉传达&#xff0c;一般以图像、图形和文字等视觉元素为主要手段&#xff0c;通过排版、配色、构…

SpringBoot、Java AOP实现方式

SpringBoot、Java AOP实现方式 搭建项目环境 我这里直接使用Maven创建项目之后再pom.xml中导入包 Spring版本 如果你的版本有最新的&#xff0c;最简单的办法就是&#xff0c;将版本都换成统一的&#xff0c;因为发布时候都是每个版本统一发布的&#xff0c;如果出现不兼容的…

大模型讲座

盘古NLP大模型典型场景 千亿大模型训练难点和解决方案 训练状态不稳定&#xff08;经常训练中断等&#xff09; 解决1&#xff1a;对loss和梯度等多维状态实时监测。对数据、学习率、参数精度、模型梯度进行针对性调整和断点恢复。 调整学习率的代码如下。调整参数、梯度类似…

kali安装HTTrack报错Unable to locate package httrack

kali安装后&#xff0c;直接安装Httrack导致报错 Unable to locate package httrack &#xff08;这里因为解决了&#xff0c;无法重现&#xff0c;则使用错误的包httrackttttt&#xff09; 原因&#xff1a;安装kali后第一次使用系统&#xff0c;则应该运行update命令 sudo …

基于ssm省出口基地公共信息服务平台论文

摘 要 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本n省出口基地公共信息服务平台就是在这样的大环境下诞生&#xff0c;其可以帮助管理者在短时间内处理完毕庞…

算法训练营Day19

#Java #二叉树 #双指针 开源学习资料 Feeling and experiences&#xff1a; 二叉搜索树的最小绝对差&#xff1a;力扣题目链接 给你一个二叉搜索树的根节点 root &#xff0c;返回 树中任意两不同节点值之间的最小差值 。 差值是一个正数&#xff0c;其数值等于两值之差的…

eNSP小实验--实现全网互通

目录 一、建立以下拓扑图&#xff0c;并实现全网互通 二、分析 1、接入层交换机SW4、SW5划分vlan 2、汇聚层交换机SW2,SW3配置ip作为vlan网关&#xff0c;与SW1直连 3、核心交换机SW1配置ip 与汇聚层交换机和R1直连 4、SW1,SW2,SW3,R1配置静态路由&#xff0c;使得vlan10,…