[英]ImportError: cannot import name 'style_from_dict' for RASA interactive learning.Incompatible prompt-toolkit version
I am trying to train the flow of dialog using interactive learning in Rasa Core using Jupyter notebook. 我正在尝试使用Jupyter笔记本在Rasa Core中使用交互式学习来训练对话框的流程。
code snippet: 代码段:
### interactive learning
import logging
from rasa_core import utils, train
from rasa_core.training import interactive
logger = logging.getLogger(__name__)
def train_agent():
return train.train_dialogue_model(domain_file="domain.yml",
stories_file="data/stories.md",
output_path="models/dialogue",
policy_config='policy_config.yml'
)
if __name__ == '__main__':
utils.configure_colored_logging(loglevel="INFO")
agent = train_agent()
logger.info("This example does not include NLU data."
"Please specify the desired intent with a preceding '/', e.g."
"'/greet' .")
interactive.run_interactive_learning(agent)
Initially I was getting: 最初我得到:
"Token not found error" pointing to "from prompt_toolkit.token import Token"
指向“来自prompt_toolkit.token导入令牌”的“找不到令牌错误”
I downgraded to prompt_toolkit==1.0.14
and tried running the code. 我降级为
prompt_toolkit==1.0.14
并尝试运行代码。
Getting: 获得:
ImportError: cannot import name 'style_from_dict'
ImportError:无法导入名称“ style_from_dict”
I feel there is a version incompatibility for prompt_toolkit
in rasa-core
and ipython
. 我觉得有一个版本不兼容的
prompt_toolkit
在rasa-core
和ipython
。 Currently using rasa-core==0.12.3
and ipython==7.2.0
. 当前使用
rasa-core==0.12.3
和ipython==7.2.0
。
Do I need to downgrade IPython
? 我需要降级
IPython
吗? Please suggest. 请提出建议。
降级为ipython 6.0.0后,错误已解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.