facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.48k stars 2.09k forks source link

interactive.py example missing files #1173

Closed santiontanon closed 6 years ago

santiontanon commented 6 years ago

Hi I just installed ParlAI, and when trying to run the interactive.py example, it is missing the "crawl-300d-2M.vec" data file. Also, the .opt file refer to specific folders such as "/private/home/edinan/ParlAI/data/models/fasttext_cc_vectors/crawl-300d-2M.vec", so, unless I'm doing something wrong, it's not going to run in anyone else's machine.

emilydinan commented 6 years ago

Hi @santiontanon -- which example did you run? Can you send me the exact command?

santiontanon commented 6 years ago

Sure! This is what I did exactly:

(here I had to install packages like torch, image, etc. as I was seeing errors)

So, I basically copied the commands from the README files in the repo. After that I got this error message:

[ warning: overriding opt['model_file'] to /Users/santiontanon/research/ParlAI/data/models/drqa/squad/model (previously: /checkpoint/edinan/20180618/drqa_sweep_re_vs_spacy/tok=re_learningrate=0.003_dropoutemb=0.3_dropoutrnn=0.4/model )]
[ Loading model /Users/santiontanon/research/ParlAI/data/models/drqa/squad/model ]
Traceback (most recent call last):
  File "interactive.py", line 26, in <module>
    interactive(opt, print_parser=parser)
  File "/Users/santiontanon/research/ParlAI/parlai/scripts/interactive.py", line 52, in interactive
    agent = create_agent(opt, requireModelExists=True)
  File "/Users/santiontanon/research/ParlAI/parlai/core/agents.py", line 447, in create_agent
    model = load_agent_module(opt)
  File "/Users/santiontanon/research/ParlAI/parlai/core/agents.py", line 342, in load_agent_module
    return model_class(new_opt)
  File "/Users/santiontanon/research/ParlAI/parlai/agents/drqa/drqa.py", line 139, in __init__
    config.set_defaults(self.opt)
  File "/Users/santiontanon/research/ParlAI/parlai/agents/drqa/config.py", line 93, in set_defaults
    raise IOError('No such file: %s' % opt['embedding_file'])
OSError: No such file: /private/home/edinan/ParlAI/data/models/fasttext_cc_vectors/crawl-300d-2M.vec

I downloaded the crawl-300d-2M.vec file separately after I saw the error, but looking at the data/models/drqa/squad/model.opt file, I saw that there are a lot of references to a specific user home folder ("/private/home/edinan"), so, I stopped there.

emilydinan commented 6 years ago

Hi @santiontanon thanks for pointing out this issue! I just pushed a PR to fix this bug, you can check it out at #1177 . Let me know if you have other questions.

santiontanon commented 6 years ago

Thanks for the quick fix!!!

It moved a bit forward but didn't quite yet work. I modified the config.py file to make it work on my system, but this is what I had to do:

Thanks a lot for the very fast responses! I can make it work now with my little hack, but happy to test again if you do another push, just to see if it works out of the box!

emilydinan commented 6 years ago

Yep sorry I realized there was a bug and made a fix after I commented here. Try the latest version!

emilydinan commented 6 years ago

Note: to interact with this model, you have to give input in the form of "context \n question"

santiontanon commented 6 years ago

yep! That one worked for me!!! Thanks again!