Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
88ada3b
translation pipeline
stevhliu Aug 12, 2026
bfeba13
add accelerate/kernels
stevhliu Aug 13, 2026
7a870d9
fix apply_chat_template
stevhliu Aug 13, 2026
1458674
remove reasoning
stevhliu Aug 13, 2026
2212c3b
fix cuda graph
stevhliu Aug 13, 2026
fc719b6
test md links and fix glossary terms
stevhliu Aug 14, 2026
9b8736a
fix markdown links
stevhliu Aug 14, 2026
ab68e42
relax tests
stevhliu Aug 14, 2026
879bbe6
fix delimiter
stevhliu Aug 14, 2026
7c45556
more delimiter fix
stevhliu Aug 14, 2026
b058d67
rebuild
stevhliu Aug 14, 2026
8d72fa9
more link fixes
stevhliu Aug 14, 2026
369695f
fix
stevhliu Aug 14, 2026
c47d835
more mask fix
stevhliu Aug 14, 2026
a1290ec
clean brackets
stevhliu Aug 17, 2026
7428e8b
fix quality
stevhliu Aug 17, 2026
dd0baff
feedback
stevhliu Aug 27, 2026
bced5d6
review
stevhliu Sep 1, 2026
c2a0cea
review
stevhliu Sep 1, 2026
1e82ae8
add manifest
stevhliu Sep 1, 2026
f717365
fix test
stevhliu Sep 2, 2026
e72a4f2
Simplify documentation translation around page caches and HF Jobs
stevhliu Sep 8, 2026
aaf56b7
Include the translation parser helper in worker checkouts
stevhliu Sep 8, 2026
9cf3268
Use Qwen3 for compatible continuous-batching translation
stevhliu Sep 8, 2026
987ef7b
Clarify marker copying and report rejected translation units
stevhliu Sep 8, 2026
91e5748
Report translation batch and page progress
stevhliu Sep 8, 2026
5019261
Omit marker instructions for plain translation inputs
stevhliu Sep 8, 2026
0ba61db
Give translation retries explicit source marker guidance
stevhliu Sep 8, 2026
c136143
Preserve translation markup with explicit paired model tags
stevhliu Sep 8, 2026
8ec5dc3
Retain accepted units and expose protected content semantics
stevhliu Sep 8, 2026
b58ad17
Restore protected payloads by identity and preserve terminal punctuation
stevhliu Sep 8, 2026
c439793
Name required formatting tags explicitly on translation retry
stevhliu Sep 8, 2026
f8707b0
Retain the verified formatting prompt with source restoration fixes
stevhliu Sep 8, 2026
f285109
Record successful Qwen3 preview and pending language review
stevhliu Sep 8, 2026
febc748
Clean up
stevhliu Sep 8, 2026
418b080
Update where to publish
stevhliu Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ on:
python_version:
type: string
description: "Python version for the build venv (e.g. '3.11'). Defaults to the runner's system Python."
translation_archive:
type: string
description: "Exact completed translation archive in an HF Bucket"
translation_archive_sha256:
type: string
description: "Archive SHA-256 returned by the translation runner"
translation_language:
type: string
description: "The single translated language built by this call"
doc_builder_revision:
type: string
description: "Pinned doc-builder implementation SHA for a translation archive"
secrets:
hf_token:
required: true
Expand All @@ -68,11 +80,13 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: 'huggingface/doc-builder'
ref: ${{ inputs.translation_archive != '' && inputs.doc_builder_revision || '' }}
path: doc-builder

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: '${{ inputs.repo_owner }}/${{ inputs.package }}'
ref: ${{ inputs.translation_archive != '' && inputs.commit_sha || '' }}
path: ${{ inputs.package }}

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -121,12 +135,16 @@ jobs:
toolchain: stable

- name: Setup environment
env:
TRANSLATION_ARCHIVE: ${{ inputs.translation_archive }}
shell: bash
run: |
uv venv ${{ inputs.python_version && format('--python {0}', inputs.python_version) || '' }}
source .venv/bin/activate
cd doc-builder
git pull origin main
if [ -z "$TRANSLATION_ARCHIVE" ]; then
git pull origin main
fi
uv pip install .
cd ..

Expand Down Expand Up @@ -186,6 +204,27 @@ jobs:

doc-builder notebook-to-mdx ${{ env.doc_folder }} --open_notebook_prefix https://colab.research.google.com/github/${{ inputs.repo_owner }}/${{ inputs.package }}/blob/$branch$remaining_part

- name: Install verified translation source
if: inputs.translation_archive != ''
env:
HF_TOKEN: ${{ secrets.hf_token }}
ARCHIVE: ${{ inputs.translation_archive }}
ARCHIVE_SHA256: ${{ inputs.translation_archive_sha256 }}
SOURCE_REVISION: ${{ inputs.commit_sha }}
BUILDER_REVISION: ${{ inputs.doc_builder_revision }}
LANGUAGE: ${{ inputs.translation_language }}
LANGUAGES: ${{ inputs.languages }}
PACKAGE: ${{ inputs.package }}
DOCS_SOURCE: ${{ env.doc_folder }}
run: |
source .venv/bin/activate
test "$PACKAGE" = transformers
test -n "$BUILDER_REVISION"
test "$LANGUAGE" = "$LANGUAGES"
python -m doc_builder.translate.artifact --archive "$ARCHIVE" --sha256 "$ARCHIVE_SHA256" \
--source-revision "$SOURCE_REVISION" --doc-builder-revision "$BUILDER_REVISION" \
--language "$LANGUAGE" --repository "$PACKAGE" --docs-source "$DOCS_SOURCE"

- name: Make documentation
shell: bash
env:
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/preview_translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Preview translated documentation

on:
workflow_dispatch:
inputs:
source_revision:
description: "Full Transformers source commit SHA"
required: true
type: string
language:
description: "Target language"
default: ja
type: string
pages:
description: "Space-separated page paths, or empty for all English pages"
type: string
bucket:
description: "Existing preview Bucket: hf://buckets/<owner>/<name>"
required: true
type: string
namespace:
description: "Hub namespace that runs and pays for the Job"
required: true
type: string

permissions:
contents: read

concurrency:
group: translation-transformers-${{ inputs.language }}-${{ inputs.bucket }}
cancel-in-progress: false

jobs:
preview:
runs-on: ubuntu-latest
timeout-minutes: 360
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ github.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '22.14.0'
- uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3
- name: Install runner and parser
run: |
uv venv --python 3.12
uv pip install -e . 'huggingface_hub==1.27.0'
npm ci --prefix kit
- name: Translate on HF Jobs
id: translation
env:
SOURCE_REVISION: ${{ inputs.source_revision }}
LANGUAGE: ${{ inputs.language }}
BUCKET: ${{ inputs.bucket }}
NAMESPACE: ${{ inputs.namespace }}
PAGES: ${{ inputs.pages }}
BUILDER_REPOSITORY: https://github.com/${{ github.repository }}.git
run: |
args=()
if [[ -n "$PAGES" ]]; then
read -r -a pages <<< "$PAGES"
args+=(--pages "${pages[@]}")
fi
.venv/bin/python -m doc_builder.translate.job --source-revision "$SOURCE_REVISION" \
--lang "$LANGUAGE" --bucket "$BUCKET" --namespace "$NAMESPACE" \
--doc-builder-repository "$BUILDER_REPOSITORY" "${args[@]}"
- name: Stop an unfinished Job
if: always()
run: .venv/bin/python -m doc_builder.translate.job --cancel-record translation-job.json
- name: Link to translated Markdown
if: success()
env:
FOLDER_URL: ${{ steps.translation.outputs.folder_url }}
PAGE_URL: ${{ steps.translation.outputs.page_url }}
run: |
printf '[Open the completed translation folder](%s)\n\n[Read a translated page](%s)\n' "$FOLDER_URL" "$PAGE_URL" >> "$GITHUB_STEP_SUMMARY"
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ jobs:
run: |
uv sync --extra all
uv add git+https://github.com/huggingface/transformers
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '22.14.0'
- name: Install translation parser
run: npm ci --prefix kit
- name: Run Tests
run: uv run python -m pytest -n 1 --dist=loadfile -s -v ./tests/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ build
dist
src/hf_doc_builder.egg-info
src/doc_builder.egg-info

# Local translation notes
/docs/translation.md
/plans/
Loading
Loading