Spaces:
Running
Running
Download acestep/training/dataset_builder_modules/core.py from adowu/ACE-Step-Training: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/adowu/ACE-Step-Training/resolve/main/acestep/training/dataset_builder_modules/core.py
- Command line
-
hf download hf://spaces/adowu/ACE-Step-Training/acestep/training/dataset_builder_modules/core.py
-
curl -L -o core.py https://huggingface.co/spaces/adowu/ACE-Step-Training/resolve/main/acestep/training/dataset_builder_modules/core.py
721 Bytes
| from typing import List | |
| from .models import AudioSample, DatasetMetadata | |
| class CoreMixin: | |
| """Base state for dataset builder.""" | |
| def __init__(self): | |
| self.samples: List[AudioSample] = [] | |
| self.metadata = DatasetMetadata() | |
| self._current_dir: str = "" | |
| def get_sample_count(self) -> int: | |
| """Get the number of samples in the dataset.""" | |
| return len(self.samples) | |
| def get_labeled_count(self) -> int: | |
| """Get the number of labeled samples.""" | |
| return sum(1 for s in self.samples if s.labeled) | |
| def get_preprocessed_count(self) -> int: | |
| """Get the number of preprocessed samples.""" | |
| return sum(1 for s in self.samples if s.preprocessed) | |