{"id":14958089,"url":"https://github.com/lucadellalib/discrete-wavlm-codec","last_synced_at":"2025-10-24T14:30:45.129Z","repository":{"id":255100801,"uuid":"848547771","full_name":"lucadellalib/discrete-wavlm-codec","owner":"lucadellalib","description":"A neural speech codec based on discrete WavLM representations","archived":false,"fork":false,"pushed_at":"2024-08-28T04:23:32.000Z","size":413,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-27T20:03:30.949Z","etag":null,"topics":["clustering","codec","hifi-gan","k-means","neural-speech-coding","pytorch","quantization","self-supervised-learning","speech-synthesis","token-extraction","wavlm"],"latest_commit_sha":null,"homepage":"https://huggingface.co/lucadellalib/discrete-wavlm-codec","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucadellalib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-08-28T00:54:11.000Z","updated_at":"2024-09-25T06:36:17.000Z","dependencies_parsed_at":"2024-09-22T06:01:14.306Z","dependency_job_id":"7654622e-167d-4d9d-a692-03a80e7b4318","html_url":"https://github.com/lucadellalib/discrete-wavlm-codec","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"349d49446b2ada4f73f11a0b2911fd6193ef5b93"},"previous_names":["lucadellalib/discrete-wavlm-codec"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucadellalib%2Fdiscrete-wavlm-codec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucadellalib%2Fdiscrete-wavlm-codec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucadellalib%2Fdiscrete-wavlm-codec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucadellalib%2Fdiscrete-wavlm-codec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucadellalib","download_url":"https://codeload.github.com/lucadellalib/discrete-wavlm-codec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868597,"owners_count":16555871,"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","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":["clustering","codec","hifi-gan","k-means","neural-speech-coding","pytorch","quantization","self-supervised-learning","speech-synthesis","token-extraction","wavlm"],"created_at":"2024-09-24T13:16:13.063Z","updated_at":"2025-10-24T14:30:44.353Z","avatar_url":"https://github.com/lucadellalib.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discrete WavLM Codec\n\nA speech codec obtained by quantizing WavLM representations via K-means clustering (see https://arxiv.org/abs/2312.09747).\n\n---------------------------------------------------------------------------------------------------------\n\n## 🛠️️ Installation\n\nFirst of all, install [Python 3.8 or later](https://www.python.org). Open a terminal and run:\n\n```\npip install huggingface-hub safetensors speechbrain torch torchaudio transformers\n```\n\n---------------------------------------------------------------------------------------------------------\n\n## ▶️ Quickstart\n\nWe use `torch.hub` to make loading the model easy (no need to clone the repository):\n\n```python\nimport torch\nimport torchaudio\n\ndwavlm = torch.hub.load(\"lucadellalib/discrete-wavlm-codec\", \"discrete_wavlm_large\", layer_ids=[6])\ndwavlm.eval().requires_grad_(False)\nsig, sample_rate = torchaudio.load(\"\u003cpath-to-audio-file\u003e\")\nsig = torchaudio.functional.resample(sig, sample_rate, dwavlm.sample_rate)\nfeats = dwavlm.sig_to_feats(sig)\ntoks = dwavlm.feats_to_toks(feats)\nqfeats = dwavlm.toks_to_qfeats(toks)\nrec_feats = dwavlm.qfeats_to_feats(qfeats)\nrec_sig = dwavlm.feats_to_sig(rec_feats)\ntorchaudio.save(\"reconstruction.wav\", rec_sig[:, 0], dwavlm.sample_rate)\n```\n\n---------------------------------------------------------------------------------------------------------\n\n## 📧 Contact\n\n[luca.dellalib@gmail.com](mailto:luca.dellalib@gmail.com)\n\n---------------------------------------------------------------------------------------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucadellalib%2Fdiscrete-wavlm-codec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucadellalib%2Fdiscrete-wavlm-codec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucadellalib%2Fdiscrete-wavlm-codec/lists"}