thu-coai / Emotional-Support-Conversation

Data and codes for ACL 2021 paper: Towards Emotional Support Dialog Systems
Other
219 stars 32 forks source link

No model file found in codes #3

Closed Adam-fei closed 3 years ago

Adam-fei commented 3 years ago

when I ran the code python BlenderEmotionalSupport.py, I got an error:

OSError: Error no file named ['pytorch_model.bin', 'tf_model.h5', 'model.ckpt.index'] found in directory ./blender-small or from_tf set to False

After downloading model file in this link, then changing the self.output_dir in class Args() , I got following error

Traceback (most recent call last): File "/data00/home/zhushaojin/work_dir/20210701_ESC/Emotional-Support-Conversation/codes/src/transformers/modeling_utils.py", line 1038, in from_pretrained state_dict = torch.load(resolved_archive_file, map_location="cpu") File "/home/zhushaojin/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/home/zhushaojin/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "BlenderEmotionalSupport.py", line 1020, in generate() File "BlenderEmotionalSupport.py", line 920, in generate from_tf=False, File "/data00/home/zhushaojin/work_dir/20210701_ESC/Emotional-Support-Conversation/codes/src/transformers/modeling_utils.py", line 1041, in from_pretrained f"Unable to load weights from pytorch checkpoint file for '{pretrained_model_name_or_path}' " OSError: Unable to load weights from pytorch checkpoint file for '/home/zhushaojin/work_dir/20210701_ESC/blenderbot_small-90M' at '/home/zhushaojin/work_dir/20210701_ESC/blenderbot_small-90M/pytorch_model.bin'If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

How can I get the correct model for running BlenderEmotionalSupport.py in codes?

lsy641 commented 3 years ago

Thank you for your caring. The models are being uploaded into huggingface.co. It will spend some time to successfully upload them. Please wait for an update and have a check at link https://huggingface.co/lsy641/ESC_Blender_Strategy and https://huggingface.co/lsy641/ESC_Blender_noStrategy