Instructions to use aehrc/cxrmate-single-tf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aehrc/cxrmate-single-tf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="aehrc/cxrmate-single-tf", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("aehrc/cxrmate-single-tf", trust_remote_code=True) model = AutoModel.from_pretrained("aehrc/cxrmate-single-tf", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modelling_single.py
#1
by ankan8145 - opened
- modelling_single.py +1 -0
modelling_single.py
CHANGED
|
@@ -233,6 +233,7 @@ class SingleCXREncoderDecoderModel(VisionEncoderDecoderModel):
|
|
| 233 |
|
| 234 |
if not past_key_values:
|
| 235 |
token_type_ids = self.token_ids_to_token_type_ids(input_ids, special_token_ids)
|
|
|
|
| 236 |
else:
|
| 237 |
token_type_ids = self.token_ids_to_token_type_ids_past(input_ids, special_token_ids)
|
| 238 |
|
|
|
|
| 233 |
|
| 234 |
if not past_key_values:
|
| 235 |
token_type_ids = self.token_ids_to_token_type_ids(input_ids, special_token_ids)
|
| 236 |
+
decoder_inputs['past_key_values']=None # Because at the first step, there was no past_key_values
|
| 237 |
else:
|
| 238 |
token_type_ids = self.token_ids_to_token_type_ids_past(input_ids, special_token_ids)
|
| 239 |
|