Hello!
I have just installed the latest version of OpenNMT-py 2.0 and CTranslate. I tried to use OpenNMT-py server with the following configuration:
{
"models_root": "/home/available_models",
"models": [
{
"id": 100,
"ct2_model": "ct2/hien",
"model": "ct2/hien",
"device": "cpu",
"timeout": 1000,
"on_timeout": "to_cpu",
"load": true,
"tokenizer": {
"type": "sentencepiece",
"model": "subword/hien/bpe/hi.model"
},
"opt": {
"beam_size": 5,
"replace_unk": true,
"verbose": true
}
}
]
}
• The model loaded successfully.
• When I translate for the first time, I get the error below.
root@mt:/home# python3 OpenNMT-py/server.py --ip "0.0.0.0" --port 3333 --url_root "/translator" --config available_models/conf.json > available_models/logs/log.log
[2021-01-25 23:22:09,630 INFO] Loading tokenizer
[2021-01-25 23:22:10,058 INFO] Loading model 100
[2021-01-25 23:22:13,504 INFO] Running translation using 100
[2021-01-25 23:22:13,504 ERROR] Error: The model for this translator was unloaded
[2021-01-25 23:22:13,504 ERROR] repr(text_to_translate): ['▁यह ▁श्रीमती ▁जी ▁सब ▁कुछ ▁चुकता ▁करेंगी']
[2021-01-25 23:22:13,504 ERROR] model: #100
[2021-01-25 23:22:13,504 ERROR] model opt: {'models': ['/home/available_models/ct2/hien'], 'fp32': False, 'int8': False, 'avg_raw_probs': False, 'data_type': 'text', 'src': 'dummy_src', 'tgt': None, 'tgt_prefix': False, 'shard_size': 10000, 'output': 'pred.txt', 'report_align': False, 'report_time': False, 'block_ngram_repeat': 0, 'ignore_when_blocking': [], 'replace_unk': True, 'ban_unk_token': False, 'phrase_table': '', 'min_length': 0, 'max_length': 100, 'max_sent_length': None, 'beam_size': 5, 'random_sampling_topk': 0, 'random_sampling_topp': 0, 'random_sampling_temp': 1.0, 'seed': -1, 'stepwise_penalty': False, 'length_penalty': 'none', 'ratio': -0.0, 'coverage_penalty': 'none', 'alpha': 0.0, 'beta': -0.0, 'log_file': '', 'log_file_level': '0', 'verbose': True, 'attn_debug': False, 'align_debug': False, 'dump_beam': '', 'n_best': 1, 'batch_size': 30, 'batch_type': 'sents', 'gpu': -1, 'cuda': False}
[2021-01-25 23:22:13,505 ERROR] Traceback (most recent call last):
File "/home/OpenNMT-py/onmt/translate/translation_server.py", line 488, in run
else self.opt.batch_size)
File "/home/OpenNMT-py/onmt/translate/translation_server.py", line 114, in translate
num_hypotheses=self.n_best
RuntimeError: The model for this translator was unloaded
[2021-01-25 23:22:13,505 INFO] Unloading model 100
• When I translate again, there is no error and I get the translation.
• I tried rebooting the server machine; no change.
What should I do? Thanks!
Kind regards,
Yasmin