facebookresearch / EmpatheticDialogues

Dialogue model that produces empathetic responses when trained on the EmpatheticDialogues dataset.
Other
444 stars 63 forks source link

Problem with empatheticdialogues/valid.csv #39

Closed albusdemens closed 3 years ago

albusdemens commented 3 years ago

Hello, I fine-tuned your model and now I would like to evaluate it, to have a feeling of how it works. When I give the command

python retrieval_train.py \
--batch-size 32 \
--bert-dim 300 \
--cuda \
--dataset-name empchat \
--dict-max-words 250000 \
--display-iter 100 \
--embeddings None \
--empchat-folder ./empatheticdialogues/ \
--max-hist-len 4 \
--model bert \
--model-dir ./test1 \
--model-name model \
--optimizer adamax \
--pretrained ./models/bert_finetuned_emoprepend1.mdl \
--reactonly

I get the following error:


Loading dictionary from None
Traceback (most recent call last):
  File "retrieval_train.py", line 297, in <module>
    main(opt)
  File "retrieval_train.py", line 262, in main
    valid_data = env.build_valid_dataloader(False)
  File "/home/ubuntu/Documents/EmpatheticDialogues/empchat/datasets/loader.py", line 187, in build_valid_dataloader
    fasttext_path=self.opt.fasttext_path,
  File "/home/ubuntu/Documents/EmpatheticDialogues/empchat/datasets/empchat.py", line 84, in __init__
    df = open(os.path.join(data_folder, f"{splitname}.csv")).readlines()
FileNotFoundError: [Errno 2] No such file or directory: '/checkpoint/ems/empathetic_dialogue/standalone/s2019_06_12__reproducing_results/bert_finetuning__emoprepend1/empatheticdialogues/valid.csv'

How do you suggest to fix this? Thanks!

EricMichaelSmith commented 3 years ago

Ah, for this you need the file for the EmpatheticDialogues validation set. You can get that with this script: https://github.com/facebookresearch/ParlAI/blob/master/parlai/tasks/empathetic_dialogues/build.py

albusdemens commented 3 years ago

Thanks that fixed the issue! One more thing: is there a way to chat with the model?

EricMichaelSmith commented 3 years ago

Hmm, not directly in this repo - one option could be to build the model into ParlAI and chat with it using this script: https://www.parl.ai/docs/cli_usage.html#interactive

albusdemens commented 3 years ago

Thanks!

nizish commented 2 years ago

Hmm, not directly in this repo - one option could be to build the model into ParlAI and chat with it using this script: https://www.parl.ai/docs/cli_usage.html#interactive

Is there any guide to build the models in this repo into ParlAI?

EricMichaelSmith commented 2 years ago

Hmm, there's not an easy tutorial as far as I know, but see https://github.com/facebookresearch/ParlAI/blob/main/parlai/agents/bart/convert_fairseq_to_parlai.py for an example of how we map the weights of an external model over to something that can be used in ParlAI

gnanukoth commented 1 year ago

Ah, for this you need the file for the EmpatheticDialogues validation set. You can get that with this script: https://github.com/facebookresearch/ParlAI/blob/master/parlai/tasks/empathetic_dialogues/build.py

Hi, can you instruct how to run this script? I do have the train, valid and test csv files in a folder and have provided the folder path for the same in the empchat-folder argument. But I keep getting the above error. I tried creating the folder path that it expects and tried placing it in multiple locations with all the csv files in that location, but still the error persists. Kindly help resolve this! Thanks for your time!

EricMichaelSmith commented 1 year ago

Ah, for this you need the file for the EmpatheticDialogues validation set. You can get that with this script: https://github.com/facebookresearch/ParlAI/blob/master/parlai/tasks/empathetic_dialogues/build.py

Hi, can you instruct how to run this script? I do have the train, valid and test csv files in a folder and have provided the folder path for the same in the empchat-folder argument. But I keep getting the above error. I tried creating the folder path that it expects and tried placing it in multiple locations with all the csv files in that location, but still the error persists. Kindly help resolve this! Thanks for your time!

@gnanukoth Try installing ParlAI given the docs and then running parlai display_data -t empathetic_dialogues - that will download the relevant files (the syntax might be wrong there but that's the general idea)