Skip to content

Commit 4267314

Browse files
committed
merge main
2 parents fcf753e + a31fa21 commit 4267314

File tree

1,217 files changed

+62357
-59315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,217 files changed

+62357
-59315
lines changed

.circleci/config.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ parameters:
77
nightly:
88
type: boolean
99
default: false
10+
GHA_Actor:
11+
type: string
12+
default: ""
13+
GHA_Action:
14+
type: string
15+
default: ""
16+
GHA_Event:
17+
type: string
18+
default: ""
19+
GHA_Meta:
20+
type: string
21+
default: ""
1022

1123
jobs:
1224
# Ensure running with CircleCI/huggingface
@@ -31,8 +43,12 @@ jobs:
3143
parallelism: 1
3244
steps:
3345
- checkout
34-
- run: if [[ "$CIRCLE_PULL_REQUEST" == "" && "$CIRCLE_BRANCH" != "main" && "$CIRCLE_BRANCH" != *-release ]]; then echo "Not a PR, not the main branch and not a release branch, skip test!"; circleci-agent step halt; fi
35-
- run: 'curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/${CIRCLE_PULL_REQUEST##*/} >> github.txt'
46+
- run: git branch
47+
- run: git log -n 1
48+
- run: python3 utils/extract_pr_number_from_circleci.py > pr_number.txt
49+
- run: echo $(cat pr_number.txt)
50+
- run: if [[ "$(cat pr_number.txt)" == "" && "$CIRCLE_BRANCH" != "main" && "$CIRCLE_BRANCH" != *-release ]]; then echo "Not a PR, not the main branch and not a release branch, skip test!"; circleci-agent step halt; fi
51+
- run: 'curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$(cat pr_number.txt) >> github.txt'
3652
- run: cat github.txt
3753
- run: (python3 -c 'import json; from datetime import datetime; fp = open("github.txt"); data = json.load(fp); fp.close(); f = "%Y-%m-%dT%H:%M:%SZ"; created = datetime.strptime(data["created_at"], f); updated = datetime.strptime(data["updated_at"], f); s = (updated - created).total_seconds(); print(int(s))' || true) > elapsed.txt
3854
- run: if [ "$(cat elapsed.txt)" == "" ]; then echo 60 > elapsed.txt; fi

.circleci/create_circleci_config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"TRANSFORMERS_IS_CI": True,
2929
"PYTEST_TIMEOUT": 120,
3030
"RUN_PIPELINE_TESTS": False,
31+
# will be adjust in `CircleCIJob.to_dict`.
32+
"RUN_FLAKY": True,
3133
}
3234
# Disable the use of {"s": None} as the output is way too long, causing the navigation on CircleCI impractical
3335
COMMON_PYTEST_OPTIONS = {"max-worker-restart": 0, "vvv": None, "rsfE":None}
@@ -108,6 +110,7 @@ def __post_init__(self):
108110
print(f"Using {self.docker_image} docker image")
109111
if self.install_steps is None:
110112
self.install_steps = ["uv venv && uv pip install ."]
113+
self.install_steps.append("uv venv && uv pip install git+https://github.com/ydshieh/[email protected] git+https://github.com/ydshieh/[email protected]")
111114
if self.pytest_options is None:
112115
self.pytest_options = {}
113116
if isinstance(self.tests_to_run, str):
@@ -126,6 +129,8 @@ def __post_init__(self):
126129

127130
def to_dict(self):
128131
env = COMMON_ENV_VARIABLES.copy()
132+
# Do not run tests decorated by @is_flaky on pull requests
133+
env['RUN_FLAKY'] = os.environ.get("CIRCLE_PULL_REQUEST", "") == ""
129134
env.update(self.additional_env)
130135

131136
job = {
@@ -393,7 +398,12 @@ def create_circleci_config(folder=None):
393398
"parameters": {
394399
# Only used to accept the parameters from the trigger
395400
"nightly": {"type": "boolean", "default": False},
396-
"tests_to_run": {"type": "string", "default": ''},
401+
# Only used to accept the parameters from GitHub Actions trigger
402+
"GHA_Actor": {"type": "string", "default": ""},
403+
"GHA_Action": {"type": "string", "default": ""},
404+
"GHA_Event": {"type": "string", "default": ""},
405+
"GHA_Meta": {"type": "string", "default": ""},
406+
"tests_to_run": {"type": "string", "default": ""},
397407
**{j.job_name + "_test_list":{"type":"string", "default":''} for j in jobs},
398408
**{j.job_name + "_parallelism":{"type":"integer", "default":1} for j in jobs},
399409
},

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ body:
1616
id: system-info
1717
attributes:
1818
label: System Info
19-
description: Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.
19+
description: Please share your system info with us. You can run the command `transformers env` and copy-paste its output below.
2020
placeholder: transformers version, platform, python version, ...
2121
validations:
2222
required: true
@@ -56,6 +56,12 @@ body:
5656
- ray/raytune: @richardliaw, @amogkam
5757
- Big Model Inference: @SunMarc
5858
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
59+
60+
Devices/Backends:
61+
62+
- AMD ROCm: @ivarflakstad
63+
- Intel XPU: @IlyasMoutawwakil
64+
- Ascend NPU: @ivarflakstad
5965
6066
Documentation: @stevhliu
6167

.github/ISSUE_TEMPLATE/migration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ body:
66
id: system-info
77
attributes:
88
label: System Info
9-
description: Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.
9+
description: Please share your system info with us. You can run the command `transformers env` and copy-paste its output below.
1010
render: shell
1111
placeholder: transformers version, platform, python version, ...
1212
validations:

.github/workflows/add-model-like.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Create model files
5555
run: |
5656
. ~/venv/bin/activate
57-
transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
57+
transformers add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
5858
make style
5959
make fix-copies
6060

.github/workflows/build_pr_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
commit_sha: ${{ github.event.pull_request.head.sha }}
1515
pr_number: ${{ github.event.number }}
1616
package: transformers
17-
languages: ar de en es fr hi it ko pt tr zh ja te
17+
languages: en

.github/workflows/check_failed_model_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run_models_gpu:
3030
name: " "
3131
runs-on:
32-
group: aws-g4dn-2xlarge-cache
32+
group: aws-g4dn-4xlarge-cache
3333
container:
3434
image: ${{ inputs.docker }}
3535
options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/

.github/workflows/doctest_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
matrix:
2929
split_keys: ${{ fromJson(inputs.split_keys) }}
3030
runs-on:
31-
group: aws-g4dn-2xlarge-cache
31+
group: aws-g4dn-4xlarge-cache
3232
container:
3333
image: huggingface/transformers-all-latest-gpu
3434
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/

.github/workflows/doctests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
setup:
1616
name: Setup
1717
runs-on:
18-
group: aws-g4dn-2xlarge-cache
18+
group: aws-g4dn-4xlarge-cache
1919
container:
2020
image: huggingface/transformers-all-latest-gpu
2121
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/

.github/workflows/model_jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
run: |
108108
echo "${{ inputs.machine_type }}"
109109
110-
if [ "${{ inputs.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
110+
if [ "${{ inputs.machine_type }}" = "aws-g4dn-4xlarge-cache" ]; then
111111
machine_type=single-gpu
112112
elif [ "${{ inputs.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
113113
machine_type=multi-gpu

0 commit comments

Comments
 (0)