Skip to content

Commit 358478e

Browse files
authored
Examples: add Bloom support for token classification (#18632)
* examples: add Bloom support for token classification (FLAX, PyTorch and TensorFlow) * examples: remove support for Bloom in token classication (FLAX and TensorFlow currently have no support for it)
1 parent 6d175c1 commit 358478e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/pytorch/token-classification/run_ner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def get_label_list(labels):
348348
)
349349

350350
tokenizer_name_or_path = model_args.tokenizer_name if model_args.tokenizer_name else model_args.model_name_or_path
351-
if config.model_type in {"gpt2", "roberta"}:
351+
if config.model_type in {"bloom", "gpt2", "roberta"}:
352352
tokenizer = AutoTokenizer.from_pretrained(
353353
tokenizer_name_or_path,
354354
cache_dir=model_args.cache_dir,

examples/pytorch/token-classification/run_ner_no_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def get_label_list(labels):
398398
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
399399
)
400400

401-
if config.model_type in {"gpt2", "roberta"}:
401+
if config.model_type in {"bloom", "gpt2", "roberta"}:
402402
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name_or_path, use_fast=True, add_prefix_space=True)
403403
else:
404404
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name_or_path, use_fast=True)

0 commit comments

Comments
 (0)