{"id":23726012,"url":"https://github.com/voidful/wav2vec-u-exp","last_synced_at":"2025-10-03T17:07:38.526Z","repository":{"id":109433324,"uuid":"384668031","full_name":"voidful/wav2vec-u-exp","owner":"voidful","description":"Build and Run Wav2vec Unsupervised Experiment","archived":false,"fork":false,"pushed_at":"2021-08-16T10:18:02.000Z","size":29455,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-23T17:08:55.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voidful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-10T10:11:18.000Z","updated_at":"2024-08-25T15:08:58.000Z","dependencies_parsed_at":"2023-05-22T10:00:40.524Z","dependency_job_id":null,"html_url":"https://github.com/voidful/wav2vec-u-exp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voidful/wav2vec-u-exp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fwav2vec-u-exp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fwav2vec-u-exp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fwav2vec-u-exp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fwav2vec-u-exp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidful","download_url":"https://codeload.github.com/voidful/wav2vec-u-exp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fwav2vec-u-exp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278196448,"owners_count":25946326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T00:18:09.871Z","updated_at":"2025-10-03T17:07:38.521Z","avatar_url":"https://github.com/voidful.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wav2vec Unsupervised (wav2vec-U) exp\n\nbuilding wav2vec Unsupervised (wav2vec-U) environment using docker with a minimum running example.   \n\n## instruction  \nBuild: `docker build -t wav2vec-u .`  \nRun:   `docker run -v $(pwd):/workspace/data --gpus all -it --rm wav2vec-u`  \n\n## minimum running example  \n\nThe `librisample` folder is a small subset of librispeech-clean 100 for evaluate this docker environment.\n\nstep 1. build and run docker image\n```shell\ndocker build -t wav2vec-u .\ndocker run -v $(pwd):/workspace/data --gpus all -it --rm wav2vec-u\n```\nor use the image from docker hub:\n```shell\ndocker run -v $(pwd):/workspace/data --gpus all -it voidful/wav2vec-u:1.0.0 bash\n```\n\nbefore running step 2, make sure that `librisample` are inside `/workspace/data/`, you can `git clone` this repo to get `librisample`.   \nstep 2. data perpetration, training and evaluation.\n```shell\n# should prepare text first, using espeak-ng are strongly recommend to support more language\n# you can adjust the threshold to guarantee the quality\nwget https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin\nHYDRA_FULL_ERROR=1 zsh $FAIRSEQ_ROOT/examples/wav2vec/unsupervised/scripts/prepare_text.sh en /workspace/data/librisample/sentence.txt /workspace/data/test_ds/ 0 espeak-ng ./lid.176.bin\n\n# audio sample cleaning\npython $FAIRSEQ_ROOT/examples/wav2vec/wav2vec_manifest.py /workspace/data/librisample/ --dest /workspace/data/test_ds/ --valid-percent 0\npython $FAIRSEQ_ROOT/examples/wav2vec/unsupervised/scripts/vads.py -r $RVAD_ROOT \u003c /workspace/data/test_ds/train.tsv \u003e /workspace/data/test_ds/train.vads\npython $FAIRSEQ_ROOT/examples/wav2vec/unsupervised/scripts/remove_silence.py --tsv /workspace/data/test_ds/train.tsv --vads /workspace/data/test_ds/train.vads --out /workspace/data/test_ds/\npython $FAIRSEQ_ROOT/examples/wav2vec/wav2vec_manifest.py /workspace/data/test_ds/ --dest /workspace/data/test_ds/ --valid-percent 0.3\n\n# prepare audio\nwget https://dl.fbaipublicfiles.com/fairseq/wav2vec/xlsr_53_56k.pt\nzsh $FAIRSEQ_ROOT/examples/wav2vec/unsupervised/scripts/prepare_audio.sh /workspace/data/test_ds/ /workspace/data/prepare_audio/ ./xlsr_53_56k.pt 512 14\n\n# parameter for training\nexport PREFIX=w2v_unsup_gan_xp\nexport TASK_DATA=/workspace/data/prepare_audio/precompute_pca512_cls128_mean_pooled/\nexport TEXT_DATA=/workspace/data/test_ds/phones/  # path to fairseq-preprocessed GAN data (phones dir)\nexport KENLM_PATH=/workspace/data/test_ds/phones/lm.phones.filtered.04.bin  # KenLM 4-gram phoneme language model (LM data = GAN data here)\nexport HYDRA_FULL_ERROR=1\n# model training\nPYTHONPATH=$FAIRSEQ_ROOT PREFIX=$PREFIX fairseq-hydra-train \\\n    -m --config-dir /workspace/project/fairseq/examples/wav2vec/unsupervised/config/gan \\\n    --config-name w2vu \\\n    task.data=${TASK_DATA} \\\n    task.text_data=${TEXT_DATA} \\\n    task.kenlm_path=${KENLM_PATH} \\\n    common.user_dir=${FAIRSEQ_ROOT}/examples/wav2vec/unsupervised \\\n    model.code_penalty=2 model.gradient_penalty=1.5 \\\n    model.smoothness_weight=0.5 'common.seed=range(0,5)'\n\n# model evaluate\ncp -r /workspace/data/test_ds/phones/* ${TASK_DATA}\npython $FAIRSEQ_ROOT/examples/wav2vec/unsupervised/w2vu_generate.py --config-dir /workspace/project/fairseq/examples/wav2vec/unsupervised/config/generate --config-name viterbi \\\nfairseq.common.user_dir=${FAIRSEQ_ROOT}/examples/wav2vec/unsupervised \\\nfairseq.task.data=${TASK_DATA} \\\nfairseq.dataset.gen_subset=valid results_path=/workspace/data/test_result \\\nfairseq.common_eval.path=/path/to/gan/checkpoint # located in multirun/20xx-xx-xx/xx-xx-xx/x/checkpoint_best.pt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidful%2Fwav2vec-u-exp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidful%2Fwav2vec-u-exp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidful%2Fwav2vec-u-exp/lists"}