pyw2v2
Work in progress!
This module is a wrapper for Wav2Vec2 models, intended to accelerate ARS research.
Install
This module can be easily be installed with pip:
pip install pyw2v2
Examples
Different examples can be found here.
Fine-tuning CTC model example
This example will show how to load a pretrained model, load dataset, process dataset, and fine-tune CTC model.
Example configuration files can be found here.
from pyw2v2 import ModelCTC, DatasetPreprocessor
from pyw2v2.utils import load_config, load_custom_dataset_commonvoice_format
if __name__ == "__main__":
# Load pretrained model
model_config = load_config("../configs/ctc/default.yaml")
model = ModelCTC(model_config)
# Loading dataset in Common Voice format
train_set = load_custom_dataset_commonvoice_format('../datasets/example', 'train')
eval_set = load_custom_dataset_commonvoice_format('../datasets/example', 'test')
# Set up dataset preprocessor
dataproc_config = load_config("../configs/dataproc/default.yaml").data_proc
data_processor = DatasetPreprocessor(dataproc_config)
data_processor.processor = model.processor
# Process data
train_set = data_processor.process(train_set, dataproc_config.n_samples_train)
eval_set = data_processor.process(eval_set, dataproc_config.n_samples_test)
# Train/Fine-tune model
model.train(train_set, eval_set)
Metadata
Release files for pyw2v2 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyw2v2-0.0.2.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyw2v2-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.4 kB
Release files / pyw2v2-0.0.2.tar.gz
| Download URL | pyw2v2-0.0.2.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f74a830d9f49e47d12e4d38d565d0f8cf4d815bd63ced2aa6ce4afe73179b51
|
|
BLAKE2b-256 checksum How to use checksums |
668e4306c7ea2a7b1e73bf63a5d5bc9788ba448b19aac18a462af34b16c848d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|
Release files / pyw2v2-0.0.2-py3-none-any.whl
| Download URL | pyw2v2-0.0.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
624f601287f8ae679e9a019034cddab7878913717962a09564270c80899d5d70
|
|
BLAKE2b-256 checksum How to use checksums |
bfd674677e3650f0b00ca76b2b0f5159ee8d84f002f831abf652a6de0e9802dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|