-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used to compile it in windows but still an error presenting #1809
Comments
The code assumes you are using Linux. Please change the code for Windows. |
opss!! its hard. I will use some chatgpt |
prepare.ps1 content generated by chatgpt # Set the environment variable for protocol buffers to use Python
$env:PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python"
# Set strict error handling (equivalent to 'set -eou pipefail')
$ErrorActionPreference = "Stop"
# Initialize stage and stop_stage variables
$stage = -1
$stop_stage = 100
# Define download directory
$dl_dir = Get-Location
# Include the parse_options script if it exists (adjust path as necessary)
. "../../../icefall/shared/parse_options.sh"
# Create the data directory if it doesn't exist
if (-not (Test-Path "data")) {
New-Item -ItemType Directory -Force -Path "data"
}
# Logging function
function Log($message) {
$scriptName = [System.IO.Path]::GetFileName($MyInvocation.MyCommand.Path)
$time = (Get-Date).ToString("yyyy-MM-dd HH:mm:ss")
Write-Host "$time ($scriptName) $message"
}
Log "dl_dir: $dl_dir"
# Stage -1: Build monotonic_align lib for vits
if ($stage -le -1 -and $stop_stage -ge -1) {
Log "Stage -1: build monotonic_align lib"
if (-not (Test-Path "vits/monotonic_align/build")) {
Set-Location "vits/monotonic_align"
python3 setup.py build_ext --inplace
Set-Location $dl_dir
} else {
Log "monotonic_align lib for vits already built"
}
if (-not (Test-Path "./matcha/monotonic_align/core.cpython-38-x86_64-linux-gnu.so")) {
Set-Location "matcha/monotonic_align"
python3 setup.py build
# Use Move-Item for PowerShell to move files
Move-Item -Path "build/lib.*/matcha/monotonic_align/core.*.so" -Destination .
# Clean up build files
Remove-Item -Recurse -Force "build"
Remove-Item -Force "core.c"
# List files to verify
Get-ChildItem -File | Format-List
Set-Location $dl_dir
} else {
Log "monotonic_align lib for matcha-tts already built"
}
}
# Stage 0: Download data (similar to existing script)
if ($stage -le 0 -and $stop_stage -ge 0) {
Log "Stage 0: Download data"
if (-not (Test-Path "$dl_dir/LJSpeech-1.1")) {
lhotse download ljspeech $dl_dir
}
}
# Stage 1: Prepare LJSpeech manifest
if ($stage -le 1 -and $stop_stage -ge 1) {
Log "Stage 1: Prepare LJSpeech manifest"
if (-not (Test-Path "data/manifests/.ljspeech.done")) {
lhotse prepare ljspeech "$dl_dir/LJSpeech-1.1" "data/manifests"
New-Item -ItemType File -Force -Path "data/manifests/.ljspeech.done"
}
}
# Stage 2: Compute spectrogram for LJSpeech
if ($stage -le 2 -and $stop_stage -ge 2) {
Log "Stage 2: Compute spectrogram for LJSpeech"
if (-not (Test-Path "data/spectrogram/.ljspeech.done")) {
& "./local/compute_spectrogram_ljspeech.py"
New-Item -ItemType File -Force -Path "data/spectrogram/.ljspeech.done"
}
if (-not (Test-Path "data/spectrogram/.ljspeech-validated.done")) {
Log "Validating data/spectrogram for LJSpeech"
python3 ./local/validate_manifest.py "data/spectrogram/ljspeech_cuts_all.jsonl.gz"
New-Item -ItemType File -Force -Path "data/spectrogram/.ljspeech-validated.done"
}
}
# Stage 3: Prepare phoneme tokens for LJSpeech
if ($stage -le 3 -and $stop_stage -ge 3) {
Log "Stage 3: Prepare phoneme tokens for LJSpeech"
if (-not (Test-Path "data/spectrogram/.ljspeech_with_token.done")) {
& "./local/prepare_tokens_ljspeech.py" --in-out-dir "./data/spectrogram"
Move-Item -Path "data/spectrogram/ljspeech_cuts_with_tokens_all.jsonl.gz" -Destination "data/spectrogram/ljspeech_cuts_all.jsonl.gz"
New-Item -ItemType File -Force -Path "data/spectrogram/.ljspeech_with_token.done"
}
}
# Stage 4: Split the LJSpeech cuts into train, valid and test sets
if ($stage -le 4 -and $stop_stage -ge 4) {
Log "Stage 4: Split the LJSpeech cuts into train, valid and test sets"
if (-not (Test-Path "data/spectrogram/.ljspeech_split.done")) {
lhotse subset --last 600 "data/spectrogram/ljspeech_cuts_all.jsonl.gz" "data/spectrogram/ljspeech_cuts_validtest.jsonl.gz"
lhotse subset --first 100 "data/spectrogram/ljspeech_cuts_validtest.jsonl.gz" "data/spectrogram/ljspeech_cuts_valid.jsonl.gz"
lhotse subset --last 500 "data/spectrogram/ljspeech_cuts_validtest.jsonl.gz" "data/spectrogram/ljspeech_cuts_test.jsonl.gz"
Remove-Item "data/spectrogram/ljspeech_cuts_validtest.jsonl.gz"
$n = ((gunzip -c "data/spectrogram/ljspeech_cuts_all.jsonl.gz" | measure -Line).Lines - 600)
lhotse subset --first $n "data/spectrogram/ljspeech_cuts_all.jsonl.gz" "data/spectrogram/ljspeech_cuts_train.jsonl.gz"
New-Item -ItemType File -Force -Path "data/spectrogram/.ljspeech_split.done"
}
}
# Stage 5: Generate token file
if ($stage -le 5 -and $stop_stage -ge 5) {
Log "Stage 5: Generate token file"
if (-not (Test-Path "data/tokens.txt")) {
& "./local/prepare_token_file.py" --tokens "data/tokens.txt"
}
}
# Stage 6: Generate fbank (used by ./matcha)
if ($stage -le 6 -and $stop_stage -ge 6) {
Log "Stage 6: Generate fbank"
if (-not (Test-Path "data/fbank/.ljspeech.done")) {
& "./local/compute_fbank_ljspeech.py"
New-Item -ItemType File -Force -Path "data/fbank/.ljspeech.done"
}
if (-not (Test-Path "data/fbank/.ljspeech-validated.done")) {
Log "Validating data/fbank for LJSpeech"
python3 ./local/validate_manifest.py "data/fbank/ljspeech_cuts_all.jsonl.gz"
New-Item -ItemType File -Force -Path "data/fbank/.ljspeech-validated.done"
}
}
# Stage 7: Prepare phoneme tokens for LJSpeech
if ($stage -le 7 -and $stop_stage -ge 7) {
Log "Stage 7: Prepare phoneme tokens for LJSpeech"
if (-not (Test-Path "data/fbank/.ljspeech_with_token.done")) {
& "./local/prepare_tokens_ljspeech.py" --in-out-dir "./data/fbank"
Move-Item -Path "data/fbank/ljspeech_cuts_with_tokens_all.jsonl.gz" -Destination "data/fbank/ljspeech_cuts_all.jsonl.gz"
New-Item -ItemType File -Force -Path "data/fbank/.ljspeech_with_token.done"
}
}
# Stage 8: Split the LJSpeech cuts into train, valid and test sets
if ($stage -le 8 -and $stop_stage -ge 8) {
Log "Stage 8: Split the LJSpeech cuts into train, valid and test sets"
if (-not (Test-Path "data/fbank/.ljspeech_split.done")) {
lhotse subset --last 600 "data/fbank/ljspeech_cuts_all.jsonl.gz" "data/fbank/ljspeech_cuts_validtest.jsonl.gz"
lhotse subset --first 100 "data/fbank/ljspeech_cuts_validtest.jsonl.gz" "data/fbank/ljspeech_cuts_valid.jsonl.gz"
lhotse subset --last 500 "data/fbank/ljspeech_cuts_validtest.jsonl.gz" "data/fbank/ljspeech_cuts_test.jsonl.gz"
Remove-Item "data/fbank/ljspeech_cuts_validtest.jsonl.gz"
$n = ((gunzip -c "data/fbank/ljspeech_cuts_all.jsonl.gz" | measure -Line).Lines - 600)
lhotse subset --first $n "data/fbank/ljspeech_cuts_all.jsonl.gz" "data/fbank/ljspeech_cuts_train.jsonl.gz"
New-Item -ItemType File -Force -Path "data/fbank/.ljspeech_split.done"
}
}
# Stage 9: Compute fbank mean and std
if ($stage -le 9 -and $stop_stage -ge 9) {
Log "Stage 9: Compute fbank mean and std"
if (-not (Test-Path "data/fbank/cmvn.json")) {
& "./local/compute_fbank_statistics.py" "data/fbank/ljspeech_cuts_train.jsonl.gz" "data/fbank/cmvn.json"
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I installed all microsoft visual studio tools
but still I have errors
The text was updated successfully, but these errors were encountered: