RVC-Project / RVC-Project/Retrieval-based-Voice-Conversion-WebUI

## CHAPTER 5: CRITICAL FILE SYSTEM AND BLUEPRINT RE-ARCHITECTURING

Open
#2,855 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
38.4k
Forks
5.3k
PR merge metrics
No merged PRs in 30d

Description

Feature 13: Replacing Positional sys.argv with Robust argparse Flags in Dataset Tools
  • The Problem:
    Currently, standalone CLI modules like train/dataset/extract_f0.py and extract_hubert_feature.py rely on raw positional command-line arguments via sys.argv. Any slight deviation in the wrapper pipeline call logic or an attempt by a user to run the script directly via a shell causes fatal argument shifts. For instance, passing an unexpected extraction string causes the script to interpret a directory path as a hardware backend, resulting in a silent crash or a misleading ValueError: Unsupported F0 extraction mode.
  • Suggested Solution:
    Refactor all dataset processing entry points to utilize Python's native argparse library. Forcing explicit, named flags (e.g., --backend cuda, --input_dir ./logs/project) instead of brittle array indices will secure the interface from argument corruption across different OS shells and Python 3.12 subprocess configurations.

Bug 14: Fragile Directory Initialization and Safe Storage Isolation
  • The Problem:
    The pitch extraction core (extract_f0.py) assumes that its target directories (2a_f0, 2b-f0nsf, 3_feature768) already exist as physical folders on the drive. If a user shifts to a new custom experiment name (e.g., creating a separate model configuration profile), the pipeline immediately crashes with FileNotFoundError or NotADirectoryError (WinError 267). This happens because the framework fails to execute a recursive folder layout check and occasionally creates flat, broken meta-strings instead of actual physical directory nodes on Windows environments.
  • Suggested Solution:
    Implement an immutable, top-level initialization pass using os.makedirs(..., exist_ok=True) inside all feature extraction entry points. Before attempting to open loggers or stream tensor data, the framework must explicitly declare and force-verify that the required nested project folder branches physically exist as genuine directory objects.

Feature 15: Dynamic Validation-Driven filelist.txt Generation (Anti-Crash Mapping)
  • The Problem:
    The current dataset preprocessing utility (train/preprocess.py via audio-slicer) can occasionally skip indices or name sliced chunks non-sequentially based on the source voice profile's underlying envelope and silences (e.g., rendering files starting directly from 0_10.npy while omitting 0_1.npy). RVC's blueprint compiler generates the filelist.txt training map "blindly," assuming a perfect arithmetic index sequence. When the PyTorch DataLoader worker processes step one, it attempts to load missing baseline tensors, resulting in an unrecoverable FileNotFoundError that halts training.
  • Suggested Solution:
    Rework the blueprint compiling script to perform a dynamic, validation-driven directory scan. Instead of guessing file rows mathematically, the script should physically read the contents of the 3_feature768 and 2a_f0 folders on the SSD and map rows into filelist.txt only if all three required AI components (WAV, HuBERT features, and F0 pitch maps) are verified to coexist simultaneously on the drive. This failsafe mechanism will make the training engine completely bulletproof against irregular dataset slicing behaviors.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading train/dataset/extract_f0.py, extract_hubert_feature.py, and train/preprocess.py, then trace how audio-slicer output becomes filelist.txt and reaches the DataLoader. Done means dataset entry points use explicit argparse flags, required nested directories are created safely, and filelist.txt includes only rows whose WAV, HuBERT, and F0 files all exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
cli, data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.