Helsinki-NLP / Opus-MT

Open neural machine translation models and web services
MIT License
592 stars 71 forks source link

Running client.py inside Docker does not give json output #13

Closed mohammedayub44 closed 4 years ago

mohammedayub44 commented 4 years ago

Hi,

I spun up a quick and basic docker container with the default models (en-es, en-fi, en-ml,en-mr). I try to run the websocket api inside the docker. echo "France passed the budget today morning." | ./opusMT-client.py -H localhost -P 10001 -s en -t es it just gives me the tokenized translated result without any json, as below , any reason why :

image

also it looks like to run translations against other models(en-fi), i cannot directly pass raw text I need to pass tokenized input for better results (including example in docs might help)

Thanks !

santhoshtr commented 4 years ago

See https://github.com/Helsinki-NLP/Opus-MT/blob/master/content_processor.py and how it is used in server.py

If you are running the docker image, from host machine you can get the web interface using localhost:8888

mohammedayub44 commented 4 years ago

@santhoshtr The web interface on port 8888 is running fine. I see the results there.
I get it, the web socket client commands are only valid if you manually install the web socket on Ubuntu and docker setup does not do this for you. Docker config is just picking up from services.json and serving the models. I will check out the manual setup.