OpenNMT / OpenNMT/CTranslate2

Safetensors support for ct2-transformers-converter

Open
#1,878 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
536
Avg merge
12h 12m
Merged PRs (30d)
4

Description

Hi,

Is there any way to leverage the "ct2-transformers-converter" utility to convert models to the safetensor format instead of the current .bin format? I'm specifically running the following command:

ct2-transformers-converter --model Helsinki-NLP/opus-mt-gaa-de --output_dir ./ct2-opus-mt-gaa-de --force --copy_files generation_config.json tokenizer_config.json vocab.json source.spm target.spm --quantization float16

Even if there isn't a current way to do this within the CTranslate2 package, if there are other ways to convert the model weights to safetensor format and still have it work with CTranslate2; that would still be really helpful!

Thanks again for the support! :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ct2-transformers-converter entry point and trace how it reads model weights from the referenced Hugging Face model. Determine whether safetensors input can be supported while preserving CTranslate2 conversion, and define completion as a working conversion path or a documented compatible alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.