Skip to content

I can not get expected result following the quick start demo #1890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nanfei01055 opened this issue May 8, 2025 · 0 comments
Open

I can not get expected result following the quick start demo #1890

nanfei01055 opened this issue May 8, 2025 · 0 comments

Comments

@nanfei01055
Copy link

I did it as link https://opennmt.net/CTranslate2/quickstart.html

c++ code as below:

`int main()
{
//system("chcp 850");

const std::string model_path("D:\\code\\CTranslate2\\models\\opus-mt-en-de\\");
const ctranslate2::models::ModelLoader model_loader(model_path);

ctranslate2::Translator translator(model_loader);

const std::vector<std::vector<std::string>> batch = { {"▁Hello", "▁World", "!", "</s>"} };
const auto translation = translator.translate_batch(batch);

for (const auto& token : translation[0].output())
    std::cout << token << ' ';
std::cout << std::endl;

return 0;

}`

but the output is:

鈻? 鈻丯ein , 鈻乶ein .

instead of '▁Hall o ▁Welt !' that in document.

my model is generated from following command:

huggingface-cli download --resume-download --local-dir-use-symlinks False Helsinki-NLP/opus-mt-en-de
cd D:\code\CTranslate2\models
ct2-transformers-converter --model Helsinki-NLP/opus-mt-en-de --quantization int8 --output_dir opus-mt-en-de

I need help.
sorry for my poor English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant