|
58 | 58 |
|
59 | 59 | # TODO: remove when https://github.com/huggingface/transformers/issues/28096 is addressed
|
60 | 60 | 'RajuKandasamy/tamillama_tiny_30m',
|
| 61 | + |
| 62 | + # TODO: remove when need for trust_remote_code can be addressed in CI |
| 63 | + 'monologg/kobert', |
61 | 64 | ]
|
62 | 65 |
|
63 | 66 | MAX_TESTS = {
|
@@ -269,15 +272,18 @@ def generate_tokenizer_tests():
|
269 | 272 | tokenizer = AutoTokenizer.from_pretrained(
|
270 | 273 | tokenizer_name,
|
271 | 274 | use_fast=False,
|
| 275 | + trust_remote_code=True, |
272 | 276 | )
|
273 | 277 | decoder_tokenizer = AutoTokenizer.from_pretrained(
|
274 | 278 | tokenizer_name,
|
275 | 279 | use_fast=True,
|
| 280 | + trust_remote_code=True, |
276 | 281 | )
|
277 | 282 |
|
278 | 283 | else:
|
279 | 284 | decoder_tokenizer = tokenizer = AutoTokenizer.from_pretrained(
|
280 |
| - tokenizer_name) |
| 285 | + tokenizer_name, |
| 286 | + trust_remote_code=True) |
281 | 287 |
|
282 | 288 | except (KeyError, EnvironmentError):
|
283 | 289 | # If a KeyError/EnvironmentError is raised from the AutoTokenizer, it
|
@@ -329,6 +335,7 @@ def generate_tokenizer_tests():
|
329 | 335 |
|
330 | 336 | # TODO: Remove once https://github.com/huggingface/transformers/pull/26678 is fixed
|
331 | 337 | use_fast='llama' not in tokenizer_id,
|
| 338 | + trust_remote_code=True, |
332 | 339 | )
|
333 | 340 | tokenizer_results = []
|
334 | 341 | for key in TOKENIZERS_WITH_CHAT_TEMPLATES[tokenizer_id]:
|
@@ -363,7 +370,7 @@ def generate_config_tests():
|
363 | 370 | print(' -', config_name)
|
364 | 371 | try:
|
365 | 372 | # Load config
|
366 |
| - config = AutoConfig.from_pretrained(config_name) |
| 373 | + config = AutoConfig.from_pretrained(config_name, trust_remote_code=True) |
367 | 374 | except Exception:
|
368 | 375 | # Something went wrong, skip this config
|
369 | 376 | continue
|
|
0 commit comments