It appears that the huggingface.co model url has some problem.
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])
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.
Environment info
transformersversion: 4.4.2Who can help
Information
It appears that the huggingface.co model url has some problem.
Code:
error message: