RasaHost
RasaHost copied to clipboard
Not able to open particular directory of rasa project
First, you have to install the package
pip install rasa-host
Then, you can run the following python code:
from RasaHost import host
host.run()
and the app should be running on http://localhost:5005
my code
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.agent import Agent
interpreter = RasaNLUInterpreter('models/current/nlu')
agent = Agent.load("models/dialogue", interpreter=interpreter)
from RasaHost import host
host.nlu_path = r"/home/ajinkz/Desktop/RASA/rasa_DEMO_1-2-19/nlu.md"
host.stories_path = r"/home/ajinkz/Desktop/RASA/rasa_DEMO_1-2-19/stories.md"
host.domain_path = r"/home/ajinkz/Desktop/RASA/rasa_DEMO_1-2-19/domain.yml"
host.agent = agent
if __name__ == '__main__':
host.run()
Error
2019-02-18 18:02:49.064460: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-02-18 18:02:58 ERROR RasaHost - Traceback (most recent call last):
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/RasaHost/__init__.py", line 50, in register_channels
if self.channels:
AttributeError: 'RasaHost' object has no attribute 'channels'
* Serving Flask app "RasaHost" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Traceback (most recent call last):
File "rasahost.py", line 21, in <module>
host.run()
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/RasaHost/__init__.py", line 66, in run
self.flask.run(self.host, self.port)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/flask/app.py", line 943, in run
run_simple(host, port, self, **options)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/werkzeug/serving.py", line 814, in run_simple
inner()
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/werkzeug/serving.py", line 774, in inner
fd=fd)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/werkzeug/serving.py", line 660, in make_server
passthrough_errors, ssl_context, fd=fd)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/site-packages/werkzeug/serving.py", line 577, in __init__
self.address_family), handler)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/socketserver.py", line 456, in __init__
self.server_bind()
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/http/server.py", line 136, in server_bind
socketserver.TCPServer.server_bind(self)
File "/home/ajinkz/miniconda3/envs/rasa3/lib/python3.6/socketserver.py", line 470, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
my directory structure
├── actions.py ├── credentials.yml ├── domain.yml ├── endpoints.yml ├── models │ ├── current │ │ └── nlu │ │ ├── checkpoint │ │ ├── crf_model.pkl │ │ ├── intent_classifier_sklearn.pkl │ │ ├── intent_classifier_tensorflow_embedding.ckpt.data-00000-of-00001 │ │ ├── intent_classifier_tensorflow_embedding.ckpt.index │ │ ├── intent_classifier_tensorflow_embedding.ckpt.meta │ │ ├── intent_classifier_tensorflow_embedding_encoded_all_intents.pkl │ │ ├── intent_classifier_tensorflow_embedding_inv_intent_dict.pkl │ │ ├── intent_featurizer_count_vectors.pkl │ │ ├── metadata.json │ │ ├── regex_featurizer.json │ │ └── training_data.json │ └── dialogue │ ├── domain.json │ ├── domain.yml │ ├── policy_0_KerasPolicy │ │ ├── featurizer.json │ │ ├── keras_model.h5 │ │ └── keras_policy.json │ ├── policy_1_FallbackPolicy │ │ └── fallback_policy.json │ ├── policy_2_MemoizationPolicy │ │ ├── featurizer.json │ │ └── memorized_turns.json │ ├── policy_3_FormPolicy │ │ ├── featurizer.json │ │ └── memorized_turns.json │ └── policy_metadata.json ├── nlu_config.yml ├── nlu.md ├── out.log