Unable to run only Rasa NLU

My Docker file contents:

version: '3.0'
services:
  rasa:
    image: rasa/rasa:latest-full
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run --enable-api

the run --enable-api command is failing. I am getting below error.

[root@cq6083maa rasa_test]# docker-compose up
Recreating rasa_test_rasa_1 ... done
Attaching to rasa_test_rasa_1
rasa_1  | usage: rasa [-h] [--version]
rasa_1  |             {init,run,shell,train,interactive,test,visualize,data,x} ...
rasa_1  | rasa: error: invalid choice: 'run --enable-api' (choose from 'init', 'run', 'shell', 'train', 'interactive', 'test', 'visualize', 'data', 'x')
rasa_test_rasa_1 exited with code 2

If my file only has ‘run’ instead of ‘run --enable-api’ it is running fine.

How to run only the NLU instead of core and at what rest API endpoint, i can get the query parsed and get the intent name.

Update: [SOLVED]

I found the solution by modifying it as below.

version: '3.0'
services:
  rasa:
    image: rasa/rasa:latest-full
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run
      - --enable-api
      - --cors
      - "*"

Any advice or suggestion on this is always welcomed if this is not the correct way to do so.

1 Like

I would also like to know how to run the custom arguments via the rasa docker image. My old rasa command was python -m rasa_core.run --enable_api -d models/dialogue -u models/nlu/current -p 5100 -c twilio --credentials credentials.yml --endpoints endpoints-twilio.yml

How can I pass the correct port to the run command, as well as pass these other arguments, so that I can get rasa to communicate with Twilio via port 5100 via docker?

The following docker-compose.yml does not work at all:

version: '3.0'

services:
  rasa:
    image: rasa/rasa:latest-full
    networks: ['rasa-network']
    ports:
    - "5005:5005"
    volumes:
    - ./:/app
            #- "./models:/app/models"
            #- "./data:/app/data"
      #- "./rasa:/usr/local/lib/python3.6/site-packages/rasa"
    command:
    - run --enable_api -d models/dialogue -u models/nlu/current -p 5100 -c twilio --credentials credentials.yml --endpoints endpoints-twilio.yml

  action_server:
    image: rasa/rasa-sdk:latest
    networks: ['rasa-network']
    ports:
    - "5055:5055"
    volumes:
    - "./actions:/app/actions"

  duckling:
    image: rasa/duckling:latest
    networks: ['rasa-network']
    ports:
    - "8000:8000"

networks: {rasa-network: {}}```

as I get the following error:

```rasa_1           | rasa: error: invalid choice: 'run --enable_api -d models/dialogue -u models/nlu/current -p 5100 -c twilio --credentials credentials.yml --endpoints endpoints-twilio.yml' (choose from 'init', 'run', 'shell', 'train', 'interactive', 'test', 'visualize', 'data', 'x')```

@kmrashutosh Your solution looks good!

@argideritzalpea Your command should look like this: run --enable-api --model models -p 5100 -c twilio --credentials credentials.yml --endpoints endpoints-twilio.yml. In Rasa 1.0 you should have one tar.gz model file that contains both models - Core and NLU. Use rasa train to train such a model. The arguments -d and -u do not exists anymore. Also --enable_api is now --enable-api.

3 Likes

Still get:

rasa_1           | usage: rasa [-h] [--version]
rasa_1           |             {init,run,shell,train,interactive,test,visualize,data,x} ...
rasa_1           | rasa: error: invalid choice: 'run --enable-api --model models -p 5100 -c twilio --credentials credentials.yml --endpoints endpoints-twilio.yml' (choose from 'init', 'run', 'shell', 'train', 'interactive', 'test', 'visualize', 'data', 'x')```

Hi @argideritzalpea

try to replace:

with:

command: ["run", "-m", "models", "--endpoints", "endpoints.yml", "-p", "5100", "--credentials", "credentials.yml", "--enable-api"]

and see if it works.

Regards Julian

1 Like

This seems to work: run --enable-api --model models --p 5200 --connector twilio --credentials credentials.yml --endpoints endpoints-twilio.yml

-c is now --connector, among other things.