Skip to content

Commit 4446f73

Browse files
sguggerelusenji
authored andcommitted
Deprecate model templates (huggingface#17062)
* Deprecate model templates * Address review comments
1 parent 1d031c0 commit 4446f73

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/model-templates.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
name: Model templates runner
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
paths:
9-
- "src/**"
10-
- "tests/**"
11-
- ".github/**"
12-
- "templates/**"
13-
types: [assigned, opened, synchronize, reopened]
4+
repository_dispatch:
5+
schedule:
6+
- cron: "0 2 * * *"
147

158
jobs:
169
run_tests_templates:

src/transformers/commands/add_new_model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import json
1616
import os
1717
import shutil
18+
import warnings
1819
from argparse import ArgumentParser, Namespace
1920
from pathlib import Path
2021
from typing import List
@@ -54,6 +55,11 @@ def __init__(self, testing: bool, testing_file: str, path=None, *args):
5455
self._path = path
5556

5657
def run(self):
58+
warnings.warn(
59+
"The command `transformers-cli add-new-model` is deprecated and will be removed in v5 of Transformers. "
60+
"It is not actively maintained anymore, so might give a result that won't pass all tests and quality "
61+
"checks, you should use `transformers-cli add-new-model-like` instead."
62+
)
5763
if not _has_cookiecutter:
5864
raise ImportError(
5965
"Model creation dependencies are required to use the `add_new_model` command. Install them by running "

0 commit comments

Comments
 (0)