Unable to run rasa server on AWS ec2

I’ve been trying to deploy my rasa model on any platform. I tried heroku, but ran into a memory error. I’ve been trying to get it to work with aws but rasa run --enable-api just runs for around 20 minutes without starting the server, and then crashes with the message “Killed”

I’m new to rasa, and i think that its my pipeline thats causing it

- name: "SpacyNLP"
  model: "en_core_web_md"
  case_sensitive: false
- name: SpacyTokenizer
- name: SpacyFeaturizer
- name: DIETClassifier
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
  analyzer: "char_wb"
  min_ngram: 1
  max_ngram: 4
- name: DIETClassifier
  epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector
  epochs: 100

The ec2 instance has 8gb of memory. Is there anything i can do to get it to work?

@z404 are you able to install rasa on AWS ec2 if yes can you share the rasa version please?

Hi @nik202 I had initially tried to use a dockerfile to create a container but installation of tensorflow kept giving memory error. So I gave up on docker and installed python 3.8.2 and rasa 3.0.8 on Debian ec2 virtual environment.

Every time I try rasa train, it stops at DIETClassifier and crashes, and every time I try rasa run --enable-api, it stops before launching the server, and crashes

@z404 can you share some screenshots of traceback?

@nik202 there is absolutely no traceback. It says Trying to load SpaCy model with name 'en_core_web_md'. and then stays there for 20 minutes. Then prints “Killed” and exits

Note that the same script runs perfectly on my local machine

@z404 is your model is trained yes or no?

Yes, the model has been trained. I have it under the models directory

@z404 ok, run this command and share me the screenshot

rasa run -m models --enable-api --cors “*” --debug

Did you install spacy in environment?

pip install rasa[spacy]
python -m spacy download en_core_web_md

@nik202 all dependencies are installed

@nik202 I’ve solved my problem by increasing ram on the vm, but I’ve run into a different problem

Even if I do rasa run --cors “*” --enable-api, i get cors error when making an api call. What do i do?

@z404 use this command please : rasa run -m models --enable-api --cors "*" --debug