How to run a ParlAI Blender chat bot?

1.9k views Asked by At

I wish to play with the Blender chatbot, but most of scripts on the Quick Start or Recipes pages won't work. For example

From https://parl.ai/projects/recipes/

python parlai/scripts/safe_interactive.py -t blended_skill_talk -mf zoo:blender/blender_90M/model

I got

Traceback (most recent call last):
  File "parlai/scripts/safe_interactive.py", line 11, in <module>
    from parlai.core.params import ParlaiParser
ModuleNotFoundError: No module named 'parlai'

or from https://parl.ai/docs/tutorial_quick.html

parlai eval_model -t twitter -mf zoo:blender/blender_90M/model

I got

17:28:54 INFO | loading dictionary from /home/jacek/ParlAI/data/models/blender/blender_90M/model.dict
17:28:54 INFO | num words = 54944
Traceback (most recent call last):
  File "/usr/local/bin/parlai", line 11, in <module>
    load_entry_point('parlai', 'console_scripts', 'parlai')()
  File "/home/jacek/ParlAI/parlai/core/script.py", line 266, in superscript_main
    SCRIPT_REGISTRY[cmd].klass._run_from_parser_and_opt(opt, parser)
  File "/home/jacek/ParlAI/parlai/core/script.py", line 88, in _run_from_parser_and_opt
    return script.run()
  File "/home/jacek/ParlAI/parlai/scripts/eval_model.py", line 232, in run
    return eval_model(self.opt, print_parser=self.parser)
  File "/home/jacek/ParlAI/parlai/scripts/eval_model.py", line 198, in eval_model
    agent = create_agent(opt, requireModelExists=True)
  File "/home/jacek/ParlAI/parlai/core/agents.py", line 394, in create_agent
    model = create_agent_from_opt_file(opt)
  File "/home/jacek/ParlAI/parlai/core/agents.py", line 347, in create_agent_from_opt_file
    return model_class(opt_from_file)
  File "/home/jacek/ParlAI/parlai/core/torch_generator_agent.py", line 445, in __init__
    super().__init__(opt, shared)
  File "/home/jacek/ParlAI/parlai/core/torch_agent.py", line 728, in __init__
    self.dict = self.build_dictionary()
  File "/home/jacek/ParlAI/parlai/core/torch_agent.py", line 812, in build_dictionary
    d = self.dictionary_class()(self.opt)
  File "/home/jacek/ParlAI/parlai/core/dict.py", line 305, in __init__
    self.bpe = bpe_factory(opt, shared)
  File "/home/jacek/ParlAI/parlai/utils/bpe.py", line 80, in bpe_factory
    bpe_helper = SubwordBPEHelper(opt, shared)
  File "/home/jacek/ParlAI/parlai/utils/bpe.py", line 292, in __init__
    raise RuntimeError(
RuntimeError: Please run "pip install 'git+https://github.com/rsennrich/subword-nmt.git#egg=subword-nmt'"

(I tried to do that pip install and it says it's already installed)

After

parlai train_model -t babi:task10k:1 -mf /tmp/babi_memnn -bs 1 -nt 4 -eps 5 -m memnn --no-cuda

I got

Parse Error: argument -mtw/--multitask-weights: invalid 'multitask_weights' value: 'memnn'

although I figured that one my self- there should be '--model' flag instead of '-m'.

I guess all of these are result of some configuration errors. I have installed ParlAI, Python and PyTorch using instructions provided on the Quick Start page, though.

System info: Ubuntu 20.04 LTS, Intel® Core™ i7-9750H CPU @ 2.60GHz × 12, 31,2 GiB RAM, GeForce GTX 1660 Ti/PCIe/SSE2.

I'm stuck, please help.

2

There are 2 answers

3
Alex Bravo On

For me Blender worked out of the box within less than 10 minutes. I was actually pleasantly surprised how easy it was to run it.

0
talha ai On

you just have to install parlai

pip install parlai

then

parlai interactive -mf zoo:blender/blender_90M/model -t blended_skill_talk