Interactive learning error during TwoStageFallback

Hi, I’m using TwoStageFallback and during interactive learning it throws me this error whenever the fallback is used (even if I say no to action_default_ask_affirmation). I am not using custom Fallback and it works fine in “rasa shell”:

2020-0> 9-03 10:51:28 ERROR rasa.core.training.interactive - An exception occurred while recording messages.

Traceback (most recent call last): File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 1420, in record_messages plot_file, File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 907, in _predict_till_next_listen await _print_history(conversation_id, endpoint) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 456, in _print_history table = _chat_history_table(events) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 540, in _chat_history_table wrapped = wrap(format_bot_output(event), bot_width(table)) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 477, in wrap return “\n”.join(textwrap.wrap(txt, max_width, replace_whitespace=False)) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 379, in wrap return w.wrap(text) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 354, in wrap return self._wrap_chunks(chunks) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 248, in _wrap_chunks raise ValueError(“invalid width %r (must be > 0)” % self.width)

ValueError: invalid width -7 (must be > 0) 2020-09-03 10:51:28 ERROR asyncio - Task exception was never retrieved future: <Task finished coro=<_serve_application..run_interactive_io() done, defined at /home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py:1505> exception=ValueError(‘invalid width -7 (must be > 0)’,)>

Traceback (most recent call last): File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 1512, in run_interactive_io conversation_id=conversation_id, File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 1420, in record_messages plot_file, File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 907, in _predict_till_next_listen await _print_history(conversation_id, endpoint) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 456, in _print_history table = _chat_history_table(events) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 540, in _chat_history_table wrapped = wrap(format_bot_output(event), bot_width(table)) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/site-packages/rasa/core/training/interactive.py”, line 477, in wrap return “\n”.join(textwrap.wrap(txt, max_width, replace_whitespace=False)) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 379, in wrap return w.wrap(text) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 354, in wrap return self._wrap_chunks(chunks) File “/home/linda/anaconda3/envs/rasa/lib/python3.6/textwrap.py”, line 248, in _wrap_chunks raise ValueError(“invalid width %r (must be > 0)” % self.width) ValueError: invalid width -7 (must be > 0)

Update: it might not be connected to the Fallback policy after all.

Hi Lindafr,

could you share the Rasa/python version that you’re using? It seems like this is printing/width issue.

Hi,

I’m using Rasa 1.10.10 and Python 3.6.8. It doesn’t work with the same Rasa and Python 3.7.7 either for me. I replay so late, because I was making sure the issue is not with wrong formatting of the dataset or sth similar. I found it odd that the error occurred only with uttering certain utterances.

I also asked my friend to test the rasa interactive on the same dataset I am using and his worked fine with Python 3.7.8. So it seems to me it might indeed be a problem of versions.

It’s slightly strange if it were just to depend on a Python version. It’s possible, but it should be very rare. Can you confirm that your friend does not have another Rasa version by any chance?

Yes, I can confirm. It is very strange indeed, but the Python version seems to be the only difference we had.

For now I might recommend switching to python3.7. If the issue persists then we can move on to create a github ticket for it and I’ll ping an internal engineer to have a look.