{"id":15671577,"url":"https://github.com/winstxnhdw/ct2hf","last_synced_at":"2025-05-06T20:26:13.166Z","repository":{"id":242115397,"uuid":"808295694","full_name":"winstxnhdw/ct2hf","owner":"winstxnhdw","description":"A friendly CLI tool for converting and uploading transformers for CTranslate2.","archived":false,"fork":false,"pushed_at":"2025-04-27T17:44:48.000Z","size":14368,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-27T18:34:22.446Z","etag":null,"topics":["ctranslate2","huggingface","huggingface-transformers","quantisation","quantization","transformers"],"latest_commit_sha":null,"homepage":"","language":"Python","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/winstxnhdw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["winstxnhdw"]}},"created_at":"2024-05-30T19:16:28.000Z","updated_at":"2025-04-27T17:44:52.000Z","dependencies_parsed_at":"2024-06-26T11:45:03.652Z","dependency_job_id":"96ca94ba-74ca-47dc-ad1c-eca652d39f79","html_url":"https://github.com/winstxnhdw/ct2hf","commit_stats":{"total_commits":83,"total_committers":3,"mean_commits":"27.666666666666668","dds":"0.24096385542168675","last_synced_commit":"2cb3bf15e3f337b997441e1ac8f9bec9ab786d60"},"previous_names":["winstxnhdw/ct2hf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2Fct2hf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2Fct2hf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2Fct2hf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winstxnhdw%2Fct2hf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winstxnhdw","download_url":"https://codeload.github.com/winstxnhdw/ct2hf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252763214,"owners_count":21800448,"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":["ctranslate2","huggingface","huggingface-transformers","quantisation","quantization","transformers"],"created_at":"2024-10-03T15:03:38.231Z","updated_at":"2025-05-06T20:26:13.159Z","avatar_url":"https://github.com/winstxnhdw.png","language":"Python","funding_links":["https://github.com/sponsors/winstxnhdw"],"categories":[],"sub_categories":[],"readme":"# ct2hf\n\n[![python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue)](https://www.python.org/)\n[![main.yml](https://github.com/winstxnhdw/ct2hf/actions/workflows/main.yml/badge.svg)](https://github.com/winstxnhdw/ct2hf/actions/workflows/main.yml)\n[![formatter.yml](https://github.com/winstxnhdw/ct2hf/actions/workflows/formatter.yml/badge.svg)](https://github.com/winstxnhdw/ct2hf/actions/workflows/formatter.yml)\n\n`ct2hf` is a user-friendly CLI tool designed to simplify the process of converting supported Hugging Face transformer models into a [CTranslate2](https://github.com/OpenNMT/CTranslate2)-compatible format. Additionally, it seamlessly uploads the converted model to your Hugging Face repository. No interaction required!\n\n## Features\n\n- **Bloat-Free**: Automatically cleans up all dependencies, even if the program has terminated unexpectedly\n- **Zero Interaction**: Convert, quantise and upload your models to Hugging Face all while brewing your coffee\n- **Memory Efficient**: Utilises the least amount of memory possible to handle large model conversions\n- **Intelligent Defaults**: Avoids common permission and storage pitfalls with sensible defaults\n- **Anti-LFS**: Only uses Git LFS when necessary, avoiding unnecessary issues that arise from using LFS\n\n## Usage\n\n\u003e [!NOTE]\\\n\u003e You have to be logged in to Hugging Face to upload the converted model onto your account. You can do this by running `uvx --no-cache --from huggingface-hub huggingface-cli login`.\n\nYou may use `pip` to install `ct2hf` but we recommended using [uv](https://github.com/astral-sh/uv) to avoid polluting your Python environment.\n\n```bash\nuvx --no-cache --python 3.13 --from git+https://github.com/winstxnhdw/ct2hf ct2hf --help\n```\n\nBy default, `ct2hf` avoids leaving behind any unnecessary files. If you would like to preserve the downloaded models, you can use the `--preserve-models` flag. Additionally, if `--quantisation` is not specified, the quantisation type defaults to `int8`.\n\n\u003e [!TIP]\\\n\u003e `ct2hf` has some memory usage optimisations that may not be compatible with some models. If you encounter any issues, try using the `--compatibility` flag.\n\n```yaml\nusage: ct2hf\n\nconvert and upload a transformer model to huggingface\n\npositional arguments:\n  model-id              transformer model to convert\n\noptions:\n  --output-name         name of the output model\n  --files-to-copy       files to copy to the output model\n  --preserve-models     do not delete the downloaded models\n  --revision            revision of the model to convert\n  --quantisation        none, int8_float32, int8_float16, int8_bfloat16, int16, float16, bfloat16, float32\n  --compatibility       use compatibility mode at the cost of higher memory usage\n```\n\n### Example\n\nThe minimal usage of `ct2hf` involves specifying the model ID of the transformer model you would like to convert.\n\n```bash\nct2hf openchat/openchat-3.6-8b-20240522\n```\n\nYou can also specify the name of the output model.\n\n```bash\nct2hf openchat/openchat-3.6-8b-20240522 --output-name openchat-3.6-ct2-int8\n```\n\nYou can also specify the files to copy to the output model.\n\n```bash\nct2hf openchat/openchat-3.6-8b-20240522 --files-to-copy tokenizer.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstxnhdw%2Fct2hf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinstxnhdw%2Fct2hf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstxnhdw%2Fct2hf/lists"}