Error trying to use https://huggingface.co/microsoft/BiomedVLP-CXR-BERT-specialized
Author: danielemolino
Pull request: no

### System Info


I was trying to use the Bert model cited in the title, but copying the code which is reported in the Model Card cause an error. 




### Who can help?

@ArthurZucker @younesbelkada 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction


The code is:
```python3
from transformers import AutoModel, AutoTokenizer

text_encoder = AutoModel.from_pretrained("microsoft/BiomedVLP-CXR-BERT-specialized", trust_remote_code=True)
text_tokenizer = AutoTokenizer.from_pretrained("microsoft/BiomedVLP-CXR-BERT-specialized", trust_remote_code=True)

text_prompts = ["There is no pneumothorax or pleural effusion",
                "No pleural effusion or pneumothorax is seen",
                "The extent of the pleural effusion is constant."]

tokenizer_output = text_tokenizer.batch_encode_plus(batch_text_or_text_pairs=text_prompts,
                                               add_special_tokens=True,
                                               padding='longest',
                                               return_tensors='pt')

embeddings = text_encoder.get_projected_text_embeddings(input_ids=tokenizer_output.input_ids,
                                                 attention_mask=tokenizer_output.attention_mask)
```

### Expected behavior

But when i try to get the embeddings i receive the sequent error: 
```
Traceback (most recent call last):
  File "C:\Users\danie\OneDrive\Desktop\Tesi\Codice\.venv\Lib\site-packages\IPython\core\interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-fdf085cd1ad3>", line 1, in <module>
    embeddings = text_encoder.get_projected_text_embeddings(input_ids=tokenizer_output.input_ids,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\danie\.cache\huggingface\modules\transformers_modules\microsoft\BiomedVLP-CXR-BERT-specialized\b59c09e51ab2410b24f4be214bbb49043fe63fc2\modeling_cxrbert.py", line 123, in get_projected_text_embeddings
    outputs = self.forward(input_ids=input_ids, attention_mask=attention_mask,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\danie\.cache\huggingface\modules\transformers_modules\microsoft\BiomedVLP-CXR-BERT-specialized\b59c09e51ab2410b24f4be214bbb49043fe63fc2\modeling_cxrbert.py", line 98, in forward
    return CXRBertOutput(
           ^^^^^^^^^^^^^^
  File "C:\Users\danie\OneDrive\Desktop\Tesi\Codice\.venv\Lib\site-packages\transformers\utils\generic.py", line 358, in __init__
    raise TypeError(
TypeError: transformers_modules.microsoft.BiomedVLP-CXR-BERT-specialized.b59c09e51ab2410b24f4be214bbb49043fe63fc2.modeling_cxrbert.CXRBertOutput is not a dataclasss. 
```
This is a subclass of ModelOutput and so must use the @dataclass decorator.

Comments:
Hi @danielemolino, thanks for opening an issue.

As per the error message, the issue is that [the model output](https://huggingface.co/microsoft/BiomedVLP-CXR-BERT-specialized/blob/b59c09e51ab2410b24f4be214bbb49043fe63fc2/modeling_cxrbert.py#L19) doesn't use the `@dataclass` decorator. I'd suggest opening a PR on the checkpoint page to add this, which the authors can then merge in if they want  

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

Thanks for reporting, @danielemolino. This has been fixed by @KendallPark in https://huggingface.co/microsoft/BiomedVLP-CXR-BERT-specialized/discussions/7.