diff --git a/.github/build_windows_packages.ps1 b/.github/build_windows_packages.ps1 index d7b68bbc..68937386 100644 --- a/.github/build_windows_packages.ps1 +++ b/.github/build_windows_packages.ps1 @@ -52,6 +52,24 @@ $tar = Get-ChildItem "$tmpDir" -Filter "*.tar" | Select-Object -First 1 & "C:\Program Files\7-Zip\7z.exe" x $tar.FullName -o"$tmpDir\extracted" -aoa Move-Item "$tmpDir\extracted\python\install" "$srcDir\runtime" +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath +$redistRoot = Join-Path $vsPath "VC\Redist\MSVC" +Get-ChildItem $redistRoot +$targetVer = Get-ChildItem -Path $redistRoot -Directory | + Where-Object { $_.Name -match "^14\." } | + Sort-Object Name -Descending | + Select-Object -First 1 +$x64Path = Join-Path $targetVer.FullName "x64" +Write-Host 111 +Get-ChildItem $x64Path +Get-ChildItem -Path $x64Path -Directory -Filter "Microsoft.*" | ForEach-Object { + Get-ChildItem -Path $_.FullName -Filter "*.dll" | ForEach-Object { + Write-Host "Copy $($_.FullName)" + Copy-Item -Path $_.FullName -Destination "$srcDir\runtime" -Force + } +} + function DownloadAndUnzip($url, $targetRelPath) { $filename = Split-Path $url -Leaf $tmpZip = "$tmpDir\$filename" @@ -175,4 +193,4 @@ if (-not $hfUser -or -not $hfToken) { $env:HF_HUB_ENABLE_HF_TRANSFER = "1" huggingface-cli upload "$hfUser/GPT-SoVITS-Packages" "$7zPath" "$7zPath" --repo-type model --token $hfToken -Write-Host "[SUCCESS] Uploaded: $7zPath to HuggingFace" \ No newline at end of file +Write-Host "[SUCCESS] Uploaded: $7zPath to HuggingFace" diff --git a/GPT_SoVITS/text/g2pw/onnx_api.py b/GPT_SoVITS/text/g2pw/onnx_api.py index 05681700..92827395 100644 --- a/GPT_SoVITS/text/g2pw/onnx_api.py +++ b/GPT_SoVITS/text/g2pw/onnx_api.py @@ -7,24 +7,22 @@ import warnings import zipfile from typing import Any, Dict, List, Tuple -from opencc import OpenCC - -warnings.filterwarnings("ignore") - - import numpy as np import onnxruntime import requests - -onnxruntime.set_default_logger_severity(3) -onnxruntime.preload_dlls() +import torch +from opencc import OpenCC from pypinyin import Style, pinyin -from transformers import AutoTokenizer +from transformers.models.auto.tokenization_auto import AutoTokenizer from ..zh_normalization.char_convert import tranditional_to_simplified from .dataset import get_char_phoneme_labels, get_phoneme_labels, prepare_onnx_input from .utils import load_config +onnxruntime.set_default_logger_severity(3) +onnxruntime.preload_dlls() +warnings.filterwarnings("ignore") + model_version = "1.1" diff --git a/go-webui.bat b/go-webui.bat index a2dfff6c..c1c81089 100644 --- a/go-webui.bat +++ b/go-webui.bat @@ -1,2 +1,6 @@ +set "SCRIPT_DIR=%~dp0" +set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" +cd /d "%SCRIPT_DIR%" +set "PATH=%SCRIPT_DIR%\runtime;%PATH%" runtime\python.exe -I webui.py zh_CN pause diff --git a/go-webui.ps1 b/go-webui.ps1 index f9427263..09103425 100644 --- a/go-webui.ps1 +++ b/go-webui.ps1 @@ -1,4 +1,7 @@ $ErrorActionPreference = "SilentlyContinue" chcp 65001 -& "$PSScriptRoot\runtime\python.exe" -I "$PSScriptRoot\webui.py" zh_CN +Set-Location $PSScriptRoot +$runtimePath = Join-Path $PSScriptRoot "runtime" +$env:PATH = "$runtimePath;$env:PATH" +& "$runtimePath\python.exe" -I "$PSScriptRoot\webui.py" zh_CN pause