Skip to content

chore(deps): update dependency hf-xet to v1.5.0#708

Open
red-hat-konflux[bot] wants to merge 1 commit into
developmentfrom
konflux/mintmaker/development/hf-xet-1.x
Open

chore(deps): update dependency hf-xet to v1.5.0#708
red-hat-konflux[bot] wants to merge 1 commit into
developmentfrom
konflux/mintmaker/development/hf-xet-1.x

Conversation

@red-hat-konflux
Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
hf-xet ==1.4.3==1.5.0 age confidence

Release Notes

huggingface/xet-core (hf-xet)

v1.5.0: [hf-xet v1.5.0] Session based API

Compare Source

Replaces the old upload_files / download_files / hash_files Python functions with a new object-oriented API that exposes XetSession and its child objects directly as PyO3 classes. This gives Python callers full control over session lifecycle, connection pooling, and progress reporting.

The previous module-level functions are kept under hf_xet/src/legacy/ and remain importable as from hf_xet import upload_files etc., but now emit DeprecationWarning.

New Python API

import hf_xet

# Optional: create a custom config (immutable; use .with_config() to derive updates)
config = hf_xet.XetConfig().with_config("data.max_concurrent_file_ingestion", 8)

# Create session; config is optional (defaults to XetConfig() with HF_XET_* env overrides)
session = hf_xet.XetSession(config=config)

# Upload — multiple files, bytes, and streaming within one commit
with session.new_upload_commit(
        endpoint="https://cas.xethub.hf.co",
        token="jwt", token_expiry_unix_secs=9999999999,
        token_refresh_url="https://…/xet-write-token/main",
        token_refresh_headers={"Authorization": "Bearer hf_…"},
    ) as commit:
    h1 = commit.start_upload_file("/path/to/model.bin")
    h2 = commit.start_upload_file("/path/to/tokenizer.json", sha256="f2358d9a…")
    h3 = commit.start_upload_bytes(b"...", name="config.json")

    with commit.start_upload_stream(name="big.bin") as stream:
    for chunk in produce_chunks():
        stream.write(chunk)

# on normal exit: wait_to_finish() is called automatically
# on exception:   abort() is called automatically

# SHA-256 sentinels
commit.start_upload_file("/path/to/model.bin", sha256=hf_xet.COMPUTE_SHA256)  # default
commit.start_upload_file("/path/to/model.bin", sha256=hf_xet.SKIP_SHA256)     # skip

# Progress callback — receives (GroupProgressReport, dict[UniqueID, ItemProgressReport])
def on_progress(group, items):
    bar.n = group.total_bytes_completed
    bar.refresh()

with session.new_upload_commit(
        token_refresh_url="https://…/xet-write-token/main",
        token_refresh_headers={"Authorization": "Bearer hf_…"},
        progress_callback=on_progress,
        progress_interval_ms=100,
    ) as commit:
    commit.start_upload_file("/path/to/model.bin")

# File download — multiple files within one group (downloads run concurrently)
file_info_a = hf_xet.XetFileInfo(hash_a, size_a)
file_info_b = hf_xet.XetFileInfo(hash_b, size_b)
with session.new_file_download_group(
        token_refresh_url="https://…/xet-read-token/main",
        token_refresh_headers={"Authorization": "Bearer hf_…"},
    ) as group:
    group.start_download_file(file_info_a, dest_path_a)
    group.start_download_file(file_info_b, dest_path_b)

# Streaming download — start/end are both optional (open-ended ranges supported)
group = session.new_download_stream_group(
    token_refresh_url="https://…/xet-read-token/main",
    token_refresh_headers={"Authorization": "Bearer hf_…"},
)
for chunk in group.download_stream(file_info):                    # whole file
    f.write(chunk)
for chunk in group.download_stream(file_info, start=1024):        # 1024 .. EOF
    f.write(chunk)
for chunk in group.download_stream(file_info, start=0, end=4096): # 0 .. 4096
    f.write(chunk)
for offset, chunk in group.download_unordered_stream(file_info):
    buf[offset:offset+len(chunk)] = chunk

# Ctrl-C handling
try:
    with session.new_upload_commit(...) as commit:
        commit.start_upload_file("model.bin")
except KeyboardInterrupt:
    session.sigint_abort()
    raise

Full Changelog: huggingface/xet-core@v1.4.3...1.5.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

To execute skipped test pipelines write comment /ok-to-test.


Documentation

Find out how to configure dependency updates in MintMaker documentation or see all available configuration options in Renovate documentation.

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
@red-hat-konflux red-hat-konflux Bot requested a review from a team as a code owner May 21, 2026 19:16
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.

0 participants