Skip to content

Translation: add transformers - #899

Merged
mishig25 merged 1 commit into
mainfrom
translate-transformers
Nov 2, 2026
Merged

mishig25 merged 1 commit into
mainfrom
translate-transformers

Conversation

@mishig25

@mishig25 mishig25 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Adds transformers to the translation job (tracked in #879). Its English main is built with a doc-builder that includes #851 (huggingface/transformers#50120).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mishig25
mishig25 force-pushed the translate-transformers branch from e75ca0e to 969513c Compare November 2, 2026 19:10
@mishig25
mishig25 merged commit 1d2fd4c into main Nov 2, 2026
4 checks passed
@mishig25
mishig25 deleted the translate-transformers branch November 2, 2026 19:12
XciD added a commit to huggingface/hf-mount that referenced this pull request Nov 3, 2026
…d poll) (#260)

## Problem

A bucket has no directory objects: a directory exists only while a file
sits under it. When a remote deletion takes the last file of a
directory, the directory itself stays listed by its parent, until an LRU
eviction or a remount.

- Live-follow removes a deleted file in place and keeps the parent
listing.
- The poll diff only looks for new remote entries. It never checks for a
subdirectory that is gone from a fresh listing.

On 2026-11-02, doc-builder deleted `transformers/main/{de,it,hi,ro}`
from `hf-doc-build/doc` (first machine translation of transformers,
huggingface/doc-builder#899). The Hub doc pods run v0.13.2 with
live-follow active. The sidecar logs show every `remote deletion of
transformers/main/de/...`, but the pods kept listing `de`, `it`, `hi`
and `ro`. The Hub lists the language folders with `readdir`, reads
`<lang>/_toctree.yml`, gets ENOENT and serves a 500 (Nightwatch item
150821).

#258 does not cover this case: the feed was healthy, so `remote_sync`
stayed true and listings are trusted.

## Fix

- **Live-follow**: collect the directories that lost a file during the
batch. After the batch, walk up from each one while it holds no file
child (or was never listed), and drop the listing of each loaded parent.
The walk stops at the first directory that still holds a file, at a
local `mkdir`, or at a directory already visited in the same batch. A
deletion in a directory that keeps other files changes nothing, so a hot
directory is not re-listed on every deletion.
- **Poll**: a polled directory that still lists a subdirectory absent
from its fresh listing drops its listing. This also covers the full poll
round that live-follow runs after a reset.

In both cases the existing reload path prunes the vanished directory,
with its guards for dirty, open and locally created entries.

`remove_remote_file` now returns the parent it unlinked from, so the
follow path does not look the parent up twice.

The "holds a file" check is O(1): a directory's `nlink` is 2 plus its
subdirectory count, so it is compared with the child count instead of
scanning the children under the write lock. A drifted-high `nlink` only
causes an extra re-list.

Pruning a stale directory removes its whole subtree. The prune in
`ensure_children_loaded` now also skips a directory that holds a
directory created by a local `mkdir` (the Hub never lists it), as it
already did for dirty or open descendants.

## Tests

- `follow_delete_of_last_files_drops_parent_listing` reproduces the doc
case: a listed `lib/main/de` loses its last files, and
`readdir(lib/main)` must not return `de` (fails without the fix).
- `follow_delete_keeps_parent_listing_when_dir_still_holds_a_file`
checks that the parent listing is kept when the directory still holds a
file.
- `follow_delete_keeps_dir_holding_a_local_mkdir`: `a/b` loses its last
remote file but holds a local `mkdir`, so the re-list of `a` must keep
`b` (fails without the prune guard).
- `poll_drops_listing_with_vanished_subdirectory` is the same case
through `apply_poll_diff` (fails without the fix).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant