Error with latest CTranslate2 version in OpenNMT-py REST server

Hi @guillaumekln,

I tried replying in the other topic but it is blocked.

I managed to compile Ctranslate2 with CUDA=10.1 and installing it in the Python virtual environment. When running onmt_server I get the following error:

File "/home/venv/lib/python3.6/site-packages/onmt/translate/translation_server.py", line 116, in <listcomp>
    scores = [[item["score"] for item in ex] for ex in preds]
KeyError: 'score'

It seems there is still a mismatch in the installation

Hi,

Please create a new topic for each of your issue. The topic Simple OpenNMT-py REST server should be for general discussion about the server, not specific issues.


To fix this error you should install the latest OpenNMT-py commit:

For example by running:

pip install https://github.com/OpenNMT/OpenNMT-py/archive/3fc16f351eb37eb9a04c69f88dce71acb278c90f.tar.gz

pip install OpenNMT-py
does not include that commit yet?

Got it! Somewhere I did not have the latest version of OpenNMT-py.

pip install OpenNMT-py --upgrade solved it

Thanks for your patience.