Empty ATTN in REST server mode


(Lpzreq) #1

I try start REST server with replace_unk mode.

th tools/rest_translation_server.lua -model es/final_epoch_release.t7 -port 5773 -replace_unk -phrase_table es/es-en.pt -withAttn

And send curl command:

curl -v -H “Content-Type: application/json” -X POST -d ‘[{ “src” : “hola” }]’ http://148..176.:5773/translator/translate

And recieve result:

Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying 148..176.
  • Connected to 148..176. (148..176.) port 5773 (#0)

POST /translator/translate HTTP/1.1
Host: 148..176.:5773
User-Agent: curl/7.50.1
Accept: /
Content-Type: application/json
Content-Length: 20

  • upload completely sent off: 20 out of 20 bytes
    < HTTP/1.1 500 Internal Server Error
    < Content-Type: text/plain
    < Date: Fri, 09 Jun 2017 08:44:56 GMT
    < Server: SGA
    < Content-Length: 115
  • Connection #0 to host 148..176. left intact
    500 Internal Server Error - Error in application: ./onmt/translate/Translator.lua:240: attempt to index a nil value

(Vincent Nguyen) #2

first make sure you run “luarocks install nn” first
then try to run your server without -withAttn and without the phrase_table options.

run the curl command again.

you confirm your model is a cpu release, right ?

(Guillaume Klein) #3

This has been fixed on master.