Instructions to use aehrc/cxrmate-rrg24 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aehrc/cxrmate-rrg24 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="aehrc/cxrmate-rrg24", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("aehrc/cxrmate-rrg24", trust_remote_code=True) model = AutoModel.from_pretrained("aehrc/cxrmate-rrg24", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload model
Browse files- modelling_cxrrg.py +1 -1
modelling_cxrrg.py
CHANGED
|
@@ -294,7 +294,7 @@ class CXRRGModel(VisionEncoderDecoderModel):
|
|
| 294 |
"""
|
| 295 |
|
| 296 |
mbatch_size, seq_len = token_ids.shape
|
| 297 |
-
token_type_ids = torch.full_like(token_ids, self.config.section_ids[0], dtype=torch.long, device=token_ids.device)
|
| 298 |
|
| 299 |
for i, j in enumerate(self.config.decoder.separator_token_ids):
|
| 300 |
# Find first occurrence of special tokens that indicate the boundary between sections:
|
|
|
|
| 294 |
"""
|
| 295 |
|
| 296 |
mbatch_size, seq_len = token_ids.shape
|
| 297 |
+
token_type_ids = torch.full_like(token_ids, self.config.decoder.section_ids[0], dtype=torch.long, device=token_ids.device)
|
| 298 |
|
| 299 |
for i, j in enumerate(self.config.decoder.separator_token_ids):
|
| 300 |
# Find first occurrence of special tokens that indicate the boundary between sections:
|