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.

I ask my question here because it’s related to the python api and I don’t think it’s worth creating a topic for it, but is there a performance difference between using the python api and the c++ one? If yes, by several seconds?

The Python API immediately calls the C++ implementation, so the performance is almost identical.

okay, thanks for your answer!