OpenNMT Forum

Ctranslate2 Python Translation API

I was trying Python API for ctranslate2 model conversion and translation.
Model conversion works fine with Python API. I am able to produce a bin file along with shared vocabulary.
When i try Python Translation API, I am getting following error.

import ctranslate2
translator = ctranslate2.Translator(model_path= "path to converted model")

Note:

  • I am using windows machine and I have cloned CTranslate github folder and working in python directory

The core CTranslate2 implementation is written in C++ and requires compilation.

We don’t have documentation for Windows so you would need to explore how you can compile the project or try using a Docker image.