Skip to content

run_mlm_no_trainer.py requires --model_name_or_path #12850

@david-waterworth

Description

@david-waterworth

The examples/pytorch/language-modeling/run_mlm_no_trainer.py script has

parser.add_argument(
    "--model_name_or_path",
    type=str,
    help="Path to pretrained model or model identifier from huggingface.co/models.",
    default=None,
    required=True,
)

Despite there being several checks in the code implying it may be None ie

if args.model_name_or_path:
    model = AutoModelForMaskedLM.from_pretrained(
        args.model_name_or_path,
        from_tf=bool(".ckpt" in args.model_name_or_path),
        config=config,
    )
else:
    logger.info("Training new model from scratch")
    model = AutoModelForMaskedLM.from_config(config)

As far as I can see it's optional, falling back to training a new model from scratch - just like run_mlm.py (I commented out required=True without any obvious issues).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions