Skip to content

Can’t download the pre-trained pegasus-large model #10838

@xiaohy9

Description

@xiaohy9

Environment info

  • transformers version: 4.4.2
  • Platform:
  • Python version: 3.7.10
  • PyTorch version (GPU?):
  • Tensorflow version (GPU?): 2.4.1
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?:

Who can help

Information

It appears that the huggingface.co model url has some problem.

Code:

from transformers import AutoTokenizer, TFAutoModelForSeq2SeqLM
tokenizer2 = AutoTokenizer.from_pretrained("google/pegasus-large")  
model2 = TFAutoModelForSeq2SeqLM.from_pretrained("google/pegasus-large")
inputs1_2 = tokenizer2.encode("summarize: " + text1, return_tensors="tf", max_length=1024)
outputs1_2 = model2.generate(inputs1_2, max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
outputs1_2, tokenizer2.decode(outputs1_2[0])

error message:

404 Client Error: Not Found for url: https://huggingface.co/google/pegasus-large/resolve/main/tf_model.h5

…

OSError: Can't load weights for 'google/pegasus-large'. Make sure that:

- 'google/pegasus-large' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'google/pegasus-large' is the correct path to a directory containing a file named one of tf_model.h5, pytorch_model.bin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions