{"id":23725984,"url":"https://github.com/voidful/dtokenizer","last_synced_at":"2025-10-25T15:06:27.790Z","repository":{"id":247426175,"uuid":"812508592","full_name":"voidful/dtokenizer","owner":"voidful","description":"discretize everything into tokens","archived":false,"fork":false,"pushed_at":"2024-08-13T10:25:22.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-16T14:35:49.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"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-06-09T05:09:32.000Z","updated_at":"2024-08-15T17:00:39.000Z","dependencies_parsed_at":"2024-07-10T15:22:40.554Z","dependency_job_id":null,"html_url":"https://github.com/voidful/dtokenizer","commit_stats":null,"previous_names":["voidful/dtokenizer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voidful/dtokenizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fdtokenizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fdtokenizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fdtokenizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fdtokenizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidful","download_url":"https://codeload.github.com/voidful/dtokenizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidful%2Fdtokenizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273541899,"owners_count":25124056,"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-09-04T02:00:08.968Z","response_time":61,"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:06.664Z","updated_at":"2025-10-05T18:19:16.128Z","avatar_url":"https://github.com/voidful.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dtokenizer\ndiscretize everything into tokens\n\n## Introduction\n`dtokenizer` is a Python library designed to discretize audio files into tokens using various models. It supports models like Hubert and Encodec for tokenization.\n\n## Installation\nTo use `dtokenizer`, first ensure you have Python and pip installed. Then, install the required dependencies by running:\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n### Hubert Tokenizer\nThe Hubert tokenizer can be used to tokenize audio files into discrete tokens and then decode them back. Here's how you can use it:\n\n```python\nfrom dtokenizer.audio.model.hubert_model import HubertTokenizer\nimport soundfile as sf\n\nht = HubertTokenizer('hubert_layer6_code100')\ncode, decodec_stuff = ht.encode_file('./sample2_22k.wav')\nwav_values = ht.decode(code)\n\n# Write the decoded audio to a file\nsf.write('output.wav', wav_values, 16000)\n```\n\n### Encodec Tokenizer\nSimilarly, the Encodec tokenizer allows for efficient audio file tokenization. Here's an example of its usage:\n\n```python\nimport torch\nfrom dtokenizer.audio.model.encodec_model import EncodecTokenizer\nimport torchaudio\n\net = EncodecTokenizer('encodec_24k_6bps')\ncode, stuff_for_decode = et.encode_file('./sample2_22k.wav')\nwav_values = et.decode(stuff_for_decode)\n\n# Save the decoded audio to a file\ntorchaudio.save('output.wav', torch.from_numpy(wav_values), 22050)\n```\n\n## Contributing\nWe welcome contributions to the `dtokenizer` project. Please feel free to submit issues or pull requests.\n\n## License\nThis project is released under the MIT License. See the LICENSE file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidful%2Fdtokenizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidful%2Fdtokenizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidful%2Fdtokenizer/lists"}