From bb8d40529e491e76717c7566aa993d404a3d9193 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Wed, 4 May 2022 09:36:38 -0400 Subject: [PATCH] Deprecate model templates (#17062) * Deprecate model templates * Address review comments --- .github/workflows/model-templates.yml | 13 +++---------- src/transformers/commands/add_new_model.py | 6 ++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/model-templates.yml b/.github/workflows/model-templates.yml index c3f4b96a180..6ade77a2792 100644 --- a/.github/workflows/model-templates.yml +++ b/.github/workflows/model-templates.yml @@ -1,16 +1,9 @@ name: Model templates runner on: - push: - branches: - - main - pull_request: - paths: - - "src/**" - - "tests/**" - - ".github/**" - - "templates/**" - types: [assigned, opened, synchronize, reopened] + repository_dispatch: + schedule: + - cron: "0 2 * * *" jobs: run_tests_templates: diff --git a/src/transformers/commands/add_new_model.py b/src/transformers/commands/add_new_model.py index 83f0188afaf..85d053a1487 100644 --- a/src/transformers/commands/add_new_model.py +++ b/src/transformers/commands/add_new_model.py @@ -15,6 +15,7 @@ import json import os import shutil +import warnings from argparse import ArgumentParser, Namespace from pathlib import Path from typing import List @@ -54,6 +55,11 @@ class AddNewModelCommand(BaseTransformersCLICommand): self._path = path def run(self): + warnings.warn( + "The command `transformers-cli add-new-model` is deprecated and will be removed in v5 of Transformers. " + "It is not actively maintained anymore, so might give a result that won't pass all tests and quality " + "checks, you should use `transformers-cli add-new-model-like` instead." + ) if not _has_cookiecutter: raise ImportError( "Model creation dependencies are required to use the `add_new_model` command. Install them by running "