Ubuntu22.04安装pyenv

Ubuntu22.04安装pyenv

下载pyenv 配置环境变量

1
2
3
4
5
6
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cd ~/.pyenv && src/configure && make -C src
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
. ~/.bashrc

查看更多

JavaScript 实现 String format with ${}

JavaScript 实现 String format with ${}

1
2
3
4
5
6
7
8
9
function str_format(str, replacements) {
return str.replace(/\$\{\w+\}/g, function(placeholderWithDelimiters) {
var placeholderWithoutDelimiters = placeholderWithDelimiters.substring(2, placeholderWithDelimiters.length - 1);
var stringReplacement = replacements[placeholderWithoutDelimiters] || placeholderWithDelimiters;
return stringReplacement;
});
}
console.log(str_format('${name} is cat', {name: 'tom'}))
console.log(str_format('${0} is cat', ['tom']))

查看更多

安装PaddleSpeech

安装PaddleSpeech

前提条件

python: 3.8.10

1
pip install paddlepaddle==2.4.2

安装PaddleSpeech

1
2
3
4
5
git clone -b r1.2 https://gitee.com/paddlepaddle/PaddleSpeech
cd PaddleSpeech
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install uvicorn==0.18.3

查看更多