Repository navigation
Translation: add transformers - #899
Merged
Merged
Conversation
31 of 42 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mishig25
force-pushed
the
translate-transformers
branch
from
November 2, 2026 19:10
e75ca0e to
969513c
Compare
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds transformers to the translation job (tracked in #879). Its English
mainis built with a doc-builder that includes #851 (huggingface/transformers#50120).🤖 Generated with Claude Code