Skip to content

Commit 8daaa6b

Browse files
authored
Merge pull request #1 from huggingface/main
sync
2 parents 6d8170e + 3996788 commit 8daaa6b

File tree

857 files changed

+103445
-13107
lines changed

Some content is hidden

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

857 files changed

+103445
-13107
lines changed

.github/workflows/benchmark.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
DIFFUSERS_IS_CI: yes
10-
HF_HUB_ENABLE_HF_TRANSFER: 1
10+
HF_XET_HIGH_PERFORMANCE: 1
1111
HF_HOME: /mnt/cache
1212
OMP_NUM_THREADS: 8
1313
MKL_NUM_THREADS: 8
@@ -28,7 +28,7 @@ jobs:
2828
options: --shm-size "16gb" --ipc host --gpus all
2929
steps:
3030
- name: Checkout diffusers
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@v6
3232
with:
3333
fetch-depth: 2
3434
- name: NVIDIA-SMI
@@ -58,7 +58,7 @@ jobs:
5858
5959
- name: Test suite reports artifacts
6060
if: ${{ always() }}
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v6
6262
with:
6363
name: benchmark_test_reports
6464
path: benchmarks/${{ env.BASE_PATH }}

.github/workflows/build_docker_images.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: docker/setup-buildx-action@v1
2929

3030
- name: Check out code
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@v6
3232

3333
- name: Find Changed Dockerfiles
3434
id: file_changes
@@ -42,18 +42,39 @@ jobs:
4242
CHANGED_FILES: ${{ steps.file_changes.outputs.all }}
4343
run: |
4444
echo "$CHANGED_FILES"
45-
for FILE in $CHANGED_FILES; do
45+
ALLOWED_IMAGES=(
46+
diffusers-pytorch-cpu
47+
diffusers-pytorch-cuda
48+
diffusers-pytorch-xformers-cuda
49+
diffusers-pytorch-minimum-cuda
50+
diffusers-doc-builder
51+
)
52+
53+
declare -A IMAGES_TO_BUILD=()
54+
55+
for FILE in $CHANGED_FILES; do
4656
# skip anything that isn't still on disk
47-
if [[ ! -f "$FILE" ]]; then
57+
if [[ ! -e "$FILE" ]]; then
4858
echo "Skipping removed file $FILE"
4959
continue
50-
fi
51-
if [[ "$FILE" == docker/*Dockerfile ]]; then
52-
DOCKER_PATH="${FILE%/Dockerfile}"
53-
DOCKER_TAG=$(basename "$DOCKER_PATH")
54-
echo "Building Docker image for $DOCKER_TAG"
55-
docker build -t "$DOCKER_TAG" "$DOCKER_PATH"
5660
fi
61+
62+
for IMAGE in "${ALLOWED_IMAGES[@]}"; do
63+
if [[ "$FILE" == docker/${IMAGE}/* ]]; then
64+
IMAGES_TO_BUILD["$IMAGE"]=1
65+
fi
66+
done
67+
done
68+
69+
if [[ ${#IMAGES_TO_BUILD[@]} -eq 0 ]]; then
70+
echo "No relevant Docker changes detected."
71+
exit 0
72+
fi
73+
74+
for IMAGE in "${!IMAGES_TO_BUILD[@]}"; do
75+
DOCKER_PATH="docker/${IMAGE}"
76+
echo "Building Docker image for $IMAGE"
77+
docker build -t "$IMAGE" "$DOCKER_PATH"
5778
done
5879
if: steps.file_changes.outputs.all != ''
5980

@@ -78,7 +99,7 @@ jobs:
7899

79100
steps:
80101
- name: Checkout repository
81-
uses: actions/checkout@v3
102+
uses: actions/checkout@v6
82103
- name: Set up Docker Buildx
83104
uses: docker/setup-buildx-action@v1
84105
- name: Login to Docker Hub

.github/workflows/build_pr_documentation.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,33 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15+
check-links:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install uv
28+
run: |
29+
curl -LsSf https://astral.sh/uv/install.sh | sh
30+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31+
32+
- name: Install doc-builder
33+
run: |
34+
uv pip install --system git+https://github.com/huggingface/doc-builder.git@main
35+
36+
- name: Check documentation links
37+
run: |
38+
uv run doc-builder check-links docs/source/en
39+
1540
build:
41+
needs: check-links
1642
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
1743
with:
1844
commit_sha: ${{ github.event.pull_request.head.sha }}

.github/workflows/codeql.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: CodeQL Security Analysis For Github Actions
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
# pull_request:
9+
10+
jobs:
11+
codeql:
12+
name: CodeQL Analysis
13+
uses: huggingface/security-workflows/.github/workflows/codeql-reusable.yml@v1
14+
permissions:
15+
security-events: write
16+
packages: read
17+
actions: read
18+
contents: read
19+
with:
20+
languages: '["actions","python"]'
21+
queries: 'security-extended,security-and-quality'
22+
runner: 'ubuntu-latest' #optional if need custom runner

.github/workflows/mirror_community_pipeline.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
mirror_community_pipeline:
2525
env:
2626
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_COMMUNITY_MIRROR }}
27-
2827
runs-on: ubuntu-22.04
2928
steps:
3029
# Checkout to correct ref
@@ -39,37 +38,41 @@ jobs:
3938
# If ref is 'refs/heads/main' => set 'main'
4039
# Else it must be a tag => set {tag}
4140
- name: Set checkout_ref and path_in_repo
41+
env:
42+
EVENT_NAME: ${{ github.event_name }}
43+
EVENT_INPUT_REF: ${{ github.event.inputs.ref }}
44+
GITHUB_REF: ${{ github.ref }}
4245
run: |
43-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
44-
if [ -z "${{ github.event.inputs.ref }}" ]; then
46+
if [ "$EVENT_NAME" == "workflow_dispatch" ]; then
47+
if [ -z "$EVENT_INPUT_REF" ]; then
4548
echo "Error: Missing ref input"
4649
exit 1
47-
elif [ "${{ github.event.inputs.ref }}" == "main" ]; then
50+
elif [ "$EVENT_INPUT_REF" == "main" ]; then
4851
echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV
4952
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
5053
else
51-
echo "CHECKOUT_REF=refs/tags/${{ github.event.inputs.ref }}" >> $GITHUB_ENV
52-
echo "PATH_IN_REPO=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
54+
echo "CHECKOUT_REF=refs/tags/$EVENT_INPUT_REF" >> $GITHUB_ENV
55+
echo "PATH_IN_REPO=$EVENT_INPUT_REF" >> $GITHUB_ENV
5356
fi
54-
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
55-
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
57+
elif [ "$GITHUB_REF" == "refs/heads/main" ]; then
58+
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
5659
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
5760
else
5861
# e.g. refs/tags/v0.28.1 -> v0.28.1
59-
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
60-
echo "PATH_IN_REPO=$(echo ${{ github.ref }} | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
62+
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
63+
echo "PATH_IN_REPO=$(echo $GITHUB_REF | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
6164
fi
6265
- name: Print env vars
6366
run: |
6467
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
6568
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
66-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v6
6770
with:
6871
ref: ${{ env.CHECKOUT_REF }}
6972

7073
# Setup + install dependencies
7174
- name: Set up Python
72-
uses: actions/setup-python@v4
75+
uses: actions/setup-python@v6
7376
with:
7477
python-version: "3.10"
7578
- name: Install dependencies
@@ -99,4 +102,4 @@ jobs:
99102
- name: Report failure status
100103
if: ${{ failure() }}
101104
run: |
102-
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure
105+
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure

0 commit comments

Comments
 (0)