PaddleSpeech MFA:阿米娅中文音色复刻计划

PaddleSpeech:阿米娅中文音色复刻计划

本篇项目是对iterhui大佬项目[PaddleSpeech 原神] 音色克隆之胡桃的复刻,使用的PaddleSpeech的版本较新,也针对新版本的PaddleSpeech做了许多配置之上的更新并加入了自己对语音的对齐、配置、训练其它任何语音音色的模块。

本篇项目旨在利用PaddleSpeech框架实现音色克隆技术,目标是复制并生成游戏《明日方舟》中的干员阿米娅(Amiya)的中文语音音色。

1. 配置 PaddleSpeech 开发环境

安装 PaddleSpeech 并在 PaddleSpeech/examples/other/tts_finetune/tts3 路径下配置 tools,下载预训练模型

In [ ]

# # 配置 PaddleSpeech 开发环境
!git clone https://gitee.com/paddlepaddle/PaddleSpeech.git
%cd /home/aistudio/
%cd PaddleSpeech
!pip install .  --user -i https://mirror.baidu.com/pypi/simple
# # 下载 NLTK
# %cd /home/aistudio
# !wget -P data https://paddlespeech.bj.bcebos.com/Parakeet/tools/nltk_data.tar.gz
# !tar zxvf data/nltk_data.tar.gz

In [ ]

# 查看paddlespeech是否正常安装,如果未安装,重新运行上一单元格。
!pip show paddlespeech

In [ ]

# 安装必要库
!pip install prettytable
!pip install soundfile
!pip install librosa
!pip install paddleaudio==1.0.1
!pip install h5py
!pip install loguru
!pip install python_speech_features
!pip install jsonlines
!pip install kaldiio

In [7]

# 删除软链接
# aistudio会报错: paddlespeech 的 repo中存在失效软链接
# 执行下面这行命令!!
!find -L /home/aistudio -type l -delete

In [ ]

# 配置 MFA & 下载预训练模型
%cd /home/aistudio
!bash env.sh

In [ ]

# 配置 MFA & 下载模型及词典
!mkdir -p tools
%cd tools
# mfa tool
!wget https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner/releases/download/v1.0.1/montreal-forced-aligner_linux.tar.gz
!tar xvf montreal-forced-aligner_linux.tar.gz
!cp montreal-forced-aligner/lib/libpython3.6m.so.1.0 montreal-forced-aligner/lib/libpython3.6m.so
# pretrained mfa model(预置的对齐模型和词典)
!mkdir -p aligner
%cd aligner
!wget https://paddlespeech.bj.bcebos.com/MFA/ernie_sat/aishell3_model.zip
!unzip aishell3_model.zip
!wget https://paddlespeech.bj.bcebos.com/MFA/AISHELL-3/with_tone/simple.lexicon
%cd ../../

In [ ]

# 拷贝mfa词典重构模型压缩包到指定目录
!cp /home/aistudio/data/data260888/mandarin_pinyin_g2p.zip -d /home/aistudio/tools/montreal-forced-aligner/pretrained_models/mandarin_pinyin_g2p.zip

2 数据集配置

本项目数据集提供了完整的wav、labelx以及MFA对齐标注文件

如果要自行对齐,请去PaddleSpeech查阅完整资料或参考后面的示例

Finetune your own AM based on FastSpeech2 with multi-speakers dataset.

解压文件中的

音频

work/dataset/阿米娅/wav/xx.wav

和标签

work/dataset/阿米娅/wav/labels.txt

对齐的textgrid

work/dataset/阿米娅/textgrid/newdir/xx.TextGrid

本项目采用阿米娅的声音完成

2.1 解压现有阿米娅音色数据集

In [ ]

%cd /home/aistudio/
!unzip /home/aistudio/data/data260882/dataset.zip -d work/

2.2 新音色数据集制作

制作MFA对齐标注文件

想要复刻自己找的语音音色提前要做的准备:

  1. 准备wav语音文件(建议30个文件以上,每个文件大约几秒的语音)
  2. 准备label.txt文件(该文件每行以“|”分割。左侧中文文字,右侧中文拼音,每个拼音后跟1、2、3、4表示音调,如下图)
  3. 按照以下目录格式存放指定文件:

制作过程:

  1. 使用label.txt文件生成各语音文件的lab文件
  2. 使用wav语音文件及对应lab拼音文件(将所有wav语音文件及对应lab拼音文件放在一个文件夹tmp中使用,注意不包含label.txt文件及其他任何文件)、mfa词典重构模型压缩包生成lexicon/txt字典文件(也可以使用别人上传的比较全的字典文件)
  3. 使用wav语音文件及对应lab拼音文件(将所有wav语音文件及对应lab拼音文件放在一个文件夹tmp中使用,注意不包含label.txt文件及其他任何文件)、lexicon/txt字典文件、mfa对齐模型压缩包生成对应textgrid文件
  4. 整理数据集文件目录,得到最终能直接拿来训练的数据集(下图中的txt文件为lab文件更改拓展名后得到,不确定是否能直接将lab代替txt使用,有兴趣的可以试一下)

最终能直接拿来训练的数据集目录结构: 

In [24]

# 生成lab文件
def txt2lab(txtPath, outPath="/home/aistudio/work/dataset/阿米娅/tmp/"):
    if not os.path.exists(outPath):
        os.makedirs(outPath)
    labelPath = txtPath + "labels.txt"
    with open(labelPath, "r") as f:
        lines = f.readlines()
        for line in lines:
            line = line.strip()
            name, pinyin = line.split("|")[0], line.split("|")[1]
            with open(outPath + name + ".lab", "w") as w:
                w.write(pinyin)
            os.system("cp {} {}".format(txtPath + name + ".wav", outPath + name + ".wav"))

txt2lab("/home/aistudio/work/dataset/阿米娅/wav/")

In [ ]

%cd /home/aistudio/tools/montreal-forced-aligner/bin/
# # 生成字典1(工具实现)
!mfa_generate_dictionary /home/aistudio/tools/montreal-forced-aligner/pretrained_models/mandarin_pinyin_g2p.zip /home/aistudio/work/dataset/阿米娅/tmp /home/aistudio/work/dataset/阿米娅/a.lexicon

# # 生成词典2(手动实现)
# # 代码片段2:生成小字典

# #全量字典:拼音->音素
# dictionary = r'D:\download\tmp\dictionary.txt'
# def getDictionary(dictionary = dictionary):
#     """
#         :param dictionary: 字典文件,每一行包含一个拼音及对应的音素,例如 "bao1 b ao1\nbeng1 b e1 ng\n"
#         :return: 字典:key是拼音,value是拼音及对应的音素,例如 key=bao1,value='bao1 b ao1\n'
#     """
#     word2phone = {}
#     with open(dictionary, 'r') as f:
#         line = f.readline()
#         while line:
#             key,value = line.split(' ',1)
#             word2phone[key] = line
#         line = f.readline()
#     return word2phone

# #生成对齐的小字典
# def getTinyDictionaryByFile(corpusPath=r'.\data_thchs30\data',outputFile = 'tinyDictionary.txt'):
# """
# inputFilePath:.lab文件。音频文件及对应的拼音文件所在目录,拼音文件一个汉字一个拼音,拼音间空格分隔如“bian4 hua1”。
# outputFile: 当前音频文件对应的所有文字的拼音形成的小字典,如“bao1 b ao1\n”
# """
# dictionary = getDictionary()
# pattern = re.compile(r'(.*)\.lab$') #只从lab文件找所有的拼音
# tinyDict = {}
# notExistsWord = ''
# for root, dirPath, files in os.walk(corpusPath):
# for readfile in files: ##遍历inputFilePath目录下的所有文件
# if pattern.match(readfile) is not None: #找出.lab文件
# with open(root+"\\"+readfile,'r') as rf: #读取出.lab文件中的所有拼音
# line = rf.readline()
# while line:
# wordList = line.split() #读取拼音
# for word in wordList:
# if word in dictionary.keys():
# tinyDict[word] = dictionary[word]
# else:notExistsWord += word + ' ' + root+"\\"+readfile+'\n';
# line = rf.readline()
# with open(outputFile, 'w') as wf:##结果写入outputFile
# for key in tinyDict:
# wf.write(tinyDict[key])
# if notExistsWord !='': print(notExistsWord)

In [ ]

# # 解决mfa tool运行时缺失文件的问题
# 查找libgfortran.so.3
!find / -name libgfortran.so.3
# 添加环境变量(临时添加)
!export LD_LIBRARY_PATH="The path you found":$LD_LIBRARY_PATH
# 如:export LD_LIBRARY_PATH=/home/user/miniconda3/envs/paddle/lib/python3.9/site-packages/paddle/libs/:$LD_LIBRARY_PATH

In [ ]

# 生成textgrid文件
!mfa_align /home/aistudio/work/dataset/阿米娅/tmp /home/aistudio/tools/aligner/simple.lexicon /home/aistudio/tools/aligner/aishell3_model.zip /home/aistudio/work/dataset/阿米娅/textgrid/newdir
%cd /home/aistudio/

2.3 编写执行cmd函数代码

In [31]

import subprocess

# 命令行执行函数,可以进入指定路径下执行
def run_cmd(cmd, cwd_path):
    p = subprocess.Popen(cmd, shell=True, cwd=cwd_path)
    res = p.wait()
    print(cmd)
    print("运行结果:", res)
    if res == 0:
        # 运行成功
        print("运行成功")
        return True
    else:
        # 运行失败
        print("运行失败")
        return False

2.4 配置各项参数

In [9]

import os

# 试验路径
exp_dir = "/home/aistudio/work/exp"
# 配置试验相关路径信息
cwd_path = "/home/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3"
# 可以参考 env.sh 文件,查看模型下载信息
pretrained_model_dir = "models/fastspeech2_mix_ckpt_1.2.0"

# # 同时上传了 wav+标注文本 以及本地生成的 textgrid 对齐文件
# 输入数据集路径
data_dir = "/home/aistudio/work/dataset/阿米娅/wav"
# 如果上传了 MFA 对齐结果,则使用已经对齐的文件
mfa_dir = "/home/aistudio/work/dataset/阿米娅/textgrid"
new_dir = "/home/aistudio/work/dataset/阿米娅/textgrid/newdir"

# 输出文件路径
wav_output_dir = os.path.join(exp_dir, "output")
os.makedirs(wav_output_dir, exist_ok=True)

dump_dir = os.path.join(exp_dir, 'dump')
output_dir = os.path.join(exp_dir, 'exp')
lang = "zh"

2.5 检查数据集是否合法

In [10]

# check oov
cmd = f"""
    python3 local/check_oov.py \
        --input_dir={data_dir} \
        --pretrained_model_dir={pretrained_model_dir} \
        --newdir_name={new_dir} \
        --lang={lang}
"""

In [11]

# 执行该步骤
run_cmd(cmd, cwd_path)
    python3 local/check_oov.py         --input_dir=/home/aistudio/work/dataset/阿米娅/wav         --pretrained_model_dir=models/fastspeech2_mix_ckpt_1.2.0         --newdir_name=/home/aistudio/work/dataset/阿米娅/textgrid/newdir         --lang=zh

运行结果: 0
运行成功
True

2.6 生成 Duration 时长信息

In [12]

cmd = f"""
python3 local/generate_duration.py \
    --mfa_dir={mfa_dir}
"""

In [9]

!cp -r /home/aistudio/PaddleSpeech/utils /home/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/local/

In [ ]

!pip install praatio
!pip install yacs

In [14]

# 执行该步骤
run_cmd(cmd, cwd_path)
python3 local/generate_duration.py     --mfa_dir=/home/aistudio/work/dataset/阿米娅/textgrid

运行结果: 0
运行成功
True

2.7 数据预处理

In [15]

cmd = f"""
python3 local/extract_feature.py \
    --duration_file="./durations.txt" \
    --input_dir={data_dir} \
    --dump_dir={dump_dir}\
    --pretrained_model_dir={pretrained_model_dir}
"""

In [ ]

!pip install inflect

In [ ]

import sys
sys.path.append("/home/aistudio/PaddleSpeech/build/lib")
print(sys.path)

In [66]

import paddlespeech
from paddlespeech.t2s.datasets.data_table import DataTable

In [17]

# 执行该步骤
run_cmd(cmd, cwd_path)
33 1
100%|██████████| 33/33 [00:07<00:00,  4.27it/s]
 16%|█▌        | 5/32 [00:00<00:00, 49.52it/s]
All frames seems to be unvoiced, this utt will be removed.
Done
100%|██████████| 32/32 [00:00<00:00, 194.00it/s]
100%|██████████| 1/1 [00:00<00:00,  2.89it/s]
100%|██████████| 1/1 [00:00<00:00, 300.04it/s]
  0%|          | 0/1 [00:00<?, ?it/s]
Done
100%|██████████| 1/1 [00:00<00:00,  3.36it/s]
100%|██████████| 1/1 [00:00<00:00, 327.12it/s]
Done

python3 local/extract_feature.py     --duration_file="./durations.txt"     --input_dir=/home/aistudio/work/dataset/阿米娅/wav     --dump_dir=/home/aistudio/work/exp/dump    --pretrained_model_dir=models/fastspeech2_mix_ckpt_1.2.0

运行结果: 0
运行成功
True

2.8 准备微调环境

In [18]

cmd = f"""
python3 local/prepare_env.py \
    --pretrained_model_dir={pretrained_model_dir} \
    --output_dir={output_dir}
"""

In [19]

# 执行该步骤
run_cmd(cmd, cwd_path)
python3 local/prepare_env.py     --pretrained_model_dir=models/fastspeech2_mix_ckpt_1.2.0     --output_dir=/home/aistudio/work/exp/exp

运行结果: 0
运行成功
True

2.9 微调并训练

不同的数据集是不好给出统一的训练参数,因此在这一步,开发者可以根据自己训练的实际情况调整参数,重要参数说明:

训练轮次: epoch

  1. epoch 决定了训练的轮次,可以结合 VisualDL 服务,在 AIstudio 中查看训练数据是否已经收敛,当数据集数量增加时,预设的训练轮次(100)不一定可以达到收敛状态
  2. 当训练轮次过多(epoch > 200)时,建议新建终端,进入/home/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3 路径下, 执行 cmd 命令,AIStudio 在打印特别多的训练信息时,会产生错误

配置文件:

/home/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/conf/finetune.yaml

In [39]

# 将默认的 yaml 拷贝一份到 exp_dir 下,方便修改
import shutil
in_label = "/home/aistudio/PaddleSpeech/examples/other/tts_finetune/tts3/conf/finetune.yaml"
shutil.copy(in_label, exp_dir)
'/home/aistudio/work/exp/finetune.yaml'

In [32]

epoch = 100
config_path = os.path.join(exp_dir, "finetune.yaml")

cmd = f"""
python3 local/finetune.py \
    --pretrained_model_dir={pretrained_model_dir} \
    --dump_dir={dump_dir} \
    --output_dir={output_dir} \
    --ngpu=1 \
    --epoch={epoch} \
    --finetune_config={config_path}
"""

In [ ]

!pip install --user paddlepaddle-gpu==2.3.2

In [ ]

# 执行该步骤
# 如果训练轮次过多,则复制上面的cmd到终端中运行
# python3 local/finetune.py --pretrained_model_dir=models/fastspeech2_mix_ckpt_1.2.0 --dump_dir=/home/aistudio/work/exp/dump --output_dir=/home/aistudio/work/exp/exp --ngpu=1 --epoch=250 --finetune_config=/home/aistudio/work/exp/finetune.yaml
run_cmd(cmd, cwd_path)

3 生成音频

输入我们需要生成的文字,即可生成对应的音频文件

3.1 文本输入

In [53]

text_dict = {
    "0": "博士!早上好!",
    "1":"源石被发现之后,人们发掘出一种通过它来施放一系列令物质改变原有性状的技术,这种技术被称为源石技艺,常被俗称为“法术”。源石技艺所运用的能源,一般被认为来自于源石本身。而人是否能施放法术,以及所能施放法术的形式、强度、效果等,通常受到先天具备的素质、后天对源石技艺的学习能力这两方面因素的制约。"
}

In [54]

# 生成 sentence.txt
text_file = os.path.join(exp_dir, "sentence.txt")
with open(text_file, "w", encoding="utf8") as f:
    for k,v in sorted(text_dict.items(), key=lambda x:x[0]):
        f.write(f"{k} {v}\n")

3.2 调训练的模型

In [55]

# 找到最新生成的模型
def find_max_ckpt(model_path):
    max_ckpt = 0
    for filename in os.listdir(model_path):
        if filename.endswith('.pdz'):
            files = filename[:-4]
            a1, a2, it = files.split("_")
            if int(it) > max_ckpt:
                max_ckpt = int(it)
    return max_ckpt

3.2 生成语音

In [56]

# 配置一下参数信息
model_path = os.path.join(output_dir, "checkpoints")
ckpt = find_max_ckpt(model_path)

cmd = f"""
python3 /home/aistudio/PaddleSpeech/paddlespeech/t2s/exps/fastspeech2/../synthesize_e2e.py \
                --am=fastspeech2_mix \
                --am_config=models/fastspeech2_mix_ckpt_1.2.0/default.yaml \
                --am_ckpt={output_dir}/checkpoints/snapshot_iter_{ckpt}.pdz \
                --am_stat=models/fastspeech2_mix_ckpt_1.2.0/speech_stats.npy \
                --voc="hifigan_aishell3" \
                --voc_config=models/hifigan_aishell3_ckpt_0.2.0/default.yaml \
                --voc_ckpt=models/hifigan_aishell3_ckpt_0.2.0/snapshot_iter_2500000.pdz \
                --voc_stat=models/hifigan_aishell3_ckpt_0.2.0/feats_stats.npy \
                --lang=mix \
                --text={text_file} \
                --output_dir={wav_output_dir} \
                --phones_dict={dump_dir}/phone_id_map.txt \
                --speaker_dict={dump_dir}/speaker_id_map.txt \
                --spk_id=0 \
                --ngpu=1
"""

In [ ]

!pip install timer
!pip install opencc==1.1.6

In [ ]

# 由于版本兼容问题,微调训练使用paddlepaddle-gpu==2.3.2,调模型生成语音使用paddlepaddle-gpu==2.6.0
!pip install --user paddlepaddle-gpu==2.6.0

In [ ]

run_cmd(cmd, cwd_path)

3.4 语音展示

In [59]

import IPython.display as ipd

ipd.Audio(os.path.join(wav_output_dir, "0.wav"))
<IPython.lib.display.Audio object>

In [60]

ipd.Audio(os.path.join(wav_output_dir, "1.wav"))
<IPython.lib.display.Audio object>

In [61]

ipd.Audio("/home/aistudio/work/dataset/阿米娅/wav/3星结束行动.wav")
<IPython.lib.display.Audio object>

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Javascript全解(基础篇)

语法与数据类型 语法 var\let\const var 声明一个变量&#xff0c;可选初始化一个值。 let 声明一个块作用域的局部变量&#xff0c;可选初始化一个值。 const 声明一个块作用域的只读常量。 用 var 或 let 语句声明的变量&#xff0c;如果没有赋初始值&#xff0c;则其值为 …

毫米波雷达深度学习技术-1.6目标识别1

1.6 目标识别 利用检测和跟踪在距离、多普勒和角度这两个维度中的任意一个进行精确的目标定位后&#xff0c;将检测到的目标分类到所需的类别中。与检测类似&#xff0c;提出了多种框架来同时使用图像和点云进行目标分类。使用图像进行目标分类的最常见方法是从检测到的目标特征…

k8s:优雅关闭pod的简单例子

先通过Dockerfile创建一个image vim Dockerfie <<<< 内容如下&#xff1a; FROM centosRUN sed -i -e "s|mirrorlist|#mirrorlist|g" /etc/yum.repos.d/CentOS-* RUN sed -i -e "s|#baseurlhttp://mirror.centos.org|baseurlhttp://vault.centos.o…

不要当网管,网管得会静态路由和路由表

1、路由表 路由表的组成 路由表由多个路由条目组成&#xff0c;每个条目通常包含以下信息&#xff1a; 目的地网络&#xff08;Destination Network&#xff09;&#xff1a; 这是数据包要到达的目标网络地址&#xff0c;通常以CIDR&#xff08;无类别域间路由&#xff09;格…

centos系统清理docker日志文件

centos系统清理docker日志文件 1.查看docker根目录位置2.清理日志 1.查看docker根目录位置 命令&#xff1a;docker info ,将Docker Root Dir 的值复制下来。如果目录中包含 等特殊符号的目录&#xff0c;需要转义 2.清理日志 创建文件&#xff1a;vim docker_logs_clean.…

Nvidia/算能 +FPGA+AI大算力边缘计算盒子:自动清理机器

总部位于硅谷的 ViaBot 正在为用于企业的机器人进行试行测试。 2016 年&#xff0c;Gregg Ratanaphanyarat 和 Dawei Ding从宾州州立大学辍学后&#xff0c;创办了一家户外清洁机器人初创公司。 如今&#xff0c;这场赌博似乎正在取得回报。二人的初创公司 ViaBot 正在与一家…

python免安装版本使用方法(win环境下)

文章目录 需求背景python下载下载免安装版本下载pip安装 参考文章&#xff1a;https://blog.csdn.net/u010835747/article/details/123731542 需求背景 在同一业务多种不同的单机需求中&#xff0c;存在业务地单一电脑运行多个不同开发人员制作的python脚本&#xff0c;但是由…

Vue07-MVVM模型

一、MVVM模型的定义 M&#xff1a;模型&#xff08;model&#xff09;&#xff1a;对应data中的数据&#xff1b;V&#xff1a;视图&#xff08;view&#xff09;&#xff1a;模版&#xff1b;VM&#xff1a;视图模型&#xff08;ViewModel&#xff09;Vue的实例对象。 Vue.js…

vue2组件封装实战系列之aside组件

组件之 GfSide 侧边栏组件一般有固定宽度用于导航菜单,布局 效果预览 属性 参数类型说明可选值默认值widthString侧边栏的宽度30% 代码实现 这里我们使用了 function 组件来实现 space 组件&#xff0c;比较简洁灵活 <template><aside class"el-aside" …

2种方法!一键批量下载1688主图、sku图、视频和详情页

最近关于如何一键下载1688主图、sku图、视频和详情页相关的问题被商友们问爆了。店雷达直接上实操教程&#xff0c;建议收藏&#xff0c;不迷路&#xff01; 方法一&#xff1a;通过选品中心下载 1、在店雷达选品中心&#xff08;如果想在1688进货的就在1688选品库中选品&…

如何选择Unity的4种批处理方式

1&#xff09;如何选择Unity的4种批处理方式 2&#xff09;Unity编辑器卡顿 3&#xff09;如何解决横屏APP在鸿蒙悬浮窗错误的变为竖屏了 4&#xff09;Hindi问题 这是第388篇UWA技术知识分享的推送&#xff0c;精选了UWA社区的热门话题&#xff0c;涵盖了UWA问答、社区帖子等技…

Ambari集成Apache Kyuubi实践

目前还有很多公司基于HDP来构建自己的大数据平台&#xff0c;随着Apache Kyuubi的持续热度&#xff0c;如何基于原有的HDP产品来集成Apache Kyuubi&#xff0c;很多人都迫切的需求。集成Apache Kyuubi到HDP中&#xff0c;主要涉及Ambari的二次开发。本文详细叙述了集成Apache K…

视频监控管理平台LntonCVS视频汇聚平台充电桩视频监控应用方案

随着新能源汽车的广泛使用&#xff0c;公众对充电设施的安全性和可靠性日益重视。为了提高充电桩的安全管理和站点运营效率&#xff0c;LntonCVS公司推出了一套全面的新能源汽车充电桩视频监控与管理解决方案。 该方案通过安装高分辨率摄像头&#xff0c;对充电桩及其周边区域进…

【C++ | this指针】一文了解C++的this指针

&#x1f601;博客主页&#x1f601;&#xff1a;&#x1f680;https://blog.csdn.net/wkd_007&#x1f680; &#x1f911;博客内容&#x1f911;&#xff1a;&#x1f36d;嵌入式开发、Linux、C语言、C、数据结构、音视频&#x1f36d; ⏰发布时间⏰&#xff1a; 本文未经允许…

【C语言】详解static和extern关键字

文章目录 1. 前言2. 作用域和生命周期2.1 作用域2.1.1 全局变量和局部变量 2.2 生命周期 3. static关键字3.1 static修饰的局部变量 4. extern关键字5. extern和static关键字的相互作用5.1 static修饰函数 6.总结 1. 前言 可能在你遇到这篇文章之前&#xff0c;你可能并未听过…

IDEA2023.1.4配置springboot项目

新建“Spring Initializr”项目 勾选以下三个依赖项即可。 springboot分为代码层、资源层和测试层。 代码层 根目录&#xff1a;src/main/java 入口启动类及程序的开发目录。在这个目录下进行业务开发、创建实体层、控制器层、数据连接层等。 资源层 根目录&#xff1a;src…

奇迹MU最强法师介绍

1、黑龙波 释放出深渊中的黑龙之魂&#xff0c;对一定范围内的目标造成中等程度伤害。 奥义&#xff1a; 怒哮——法师释放出深渊龙魂的怨怒之力&#xff0c;在电闪雷鸣中中咆哮的龙魂将对敌人额外造成少量伤害。 魂阵——法师利用法阵控制黑龙之魂进行更大范围的攻击&…

史上最强 AI 翻译诞生了!拳打谷歌,脚踢 DeepL

CoT 推理范式 默认情况下&#xff0c;大语言模型通常是直接给出问题的最终答案&#xff0c;中间推理过程是隐含的、不透明的&#xff0c;无法发挥出大模型最极致的理解能力。如果你用它来充当翻译&#xff0c;可能效果和传统的机器翻译也差不了太多。 如果我们给大模型设计一…

天行健咨询 | 谢宁DOE培训的课程内容有哪些?

谢宁DOE培训的课程内容丰富而深入&#xff0c;旨在帮助学员掌握谢宁问题解决方法在质量管理中的重要作用&#xff0c;并学会如何运用这一方法工具&#xff0c;在不中断生产过程的前提下&#xff0c;找出并解决生产中遇到的复杂而顽固的问题。 首先&#xff0c;课程会详细介绍谢…

SpringCloud Hystrix服务熔断实例总结

SpringCloud Hystrix断路器-服务熔断与降级和HystrixDashboard SpringCloud Hystrix服务降级实例总结 本文采用版本为Hoxton.SR1系列&#xff0c;SpringBoot为2.2.2.RELEASE <dependency><groupId>org.springframework.cloud</groupId><artifactId>s…