Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d83bfe8
baby step
coyotte508 Mar 7, 2025
5cd51b9
JWT management for xet access (WIP)
coyotte508 Mar 7, 2025
013fa43
Merge remote-tracking branch 'origin/main' into xet-blob
coyotte508 Mar 11, 2025
c9ad0d3
add clone() to XetBlob
coyotte508 Mar 11, 2025
79fa592
first step in xet protocol: get reconstruction info
coyotte508 Mar 11, 2025
4f316c6
basic test
coyotte508 Mar 11, 2025
a4502c2
Progress in reconstruction algorithm
coyotte508 Mar 12, 2025
dba172c
parse chunks
coyotte508 Mar 12, 2025
e716795
go back to simpler stream handling
coyotte508 Mar 12, 2025
2f8fc9f
only read necessary data
coyotte508 Mar 12, 2025
cc91ec5
add lz4 dependency
coyotte508 Mar 12, 2025
a514086
Support LZ4 decompression
coyotte508 Mar 12, 2025
ca0feb9
better description of file format
coyotte508 Mar 12, 2025
daec055
can skip whole chunks at the start of the term
coyotte508 Mar 12, 2025
bbbe85c
fixup! can skip whole chunks at the start of the term
coyotte508 Mar 12, 2025
4d60012
Merge remote-tracking branch 'origin/main' into xet-blob
coyotte508 Mar 12, 2025
e7639a4
export xet blob
coyotte508 Mar 13, 2025
cb5abc9
Vendor lz4js
coyotte508 Mar 13, 2025
7510f52
Use more recent version of lz4js
coyotte508 Mar 13, 2025
4dec1ff
Merge branch 'main' into xet-blob
coyotte508 Mar 13, 2025
5981751
reload reconstruction info if expired
coyotte508 Mar 13, 2025
8acad93
Add bg4 decompression algorithm
coyotte508 Mar 13, 2025
b319903
alternative implementation of bg4
coyotte508 Mar 13, 2025
7463d74
remove only modifier
coyotte508 Mar 13, 2025
9eca789
Add failing test
coyotte508 Mar 13, 2025
f8be34d
more failures
coyotte508 Mar 13, 2025
8025230
Fix download bug
coyotte508 Mar 14, 2025
8bda5ff
add tip for running browser tests in CONTRIBUTING.md
coyotte508 Mar 14, 2025
9a1f102
add longer timeout on webblob tests
coyotte508 Mar 14, 2025
bf1ae83
debug xet test
coyotte508 Mar 14, 2025
f4d29f9
log chrome version in runner
coyotte508 Mar 14, 2025
f5763f3
skip one xet test while inside browser
coyotte508 Mar 14, 2025
e00066f
more tests with bigger timeout
coyotte508 Mar 14, 2025
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
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ It's not a hard requirement, but please consider using an icon from [Gitmoji](ht

## Tests

If you want to run only specific tests, you can do `pnpm test -- -t "test name"`
If you want to run only specific tests, you can do `pnpm test -- -t "test name"`.

You can also do `npx vitest ./packages/hub/src/utils/XetBlob.spec.ts` to run a specific test file.

## Adding a package

Expand Down
1 change: 1 addition & 0 deletions packages/hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ Under the hood, `@huggingface/hub` uses a lazy blob implementation to load the f
## Dependencies

- `@huggingface/tasks` : Typings only
- `@huggingface/lz4` : URL join utility
4 changes: 3 additions & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
"author": "Hugging Face",
"license": "MIT",
"devDependencies": {
"@types/lz4js": "^0.2.1",
"@types/node": "^20.11.28"
},
"dependencies": {
"@huggingface/tasks": "workspace:^"
"@huggingface/tasks": "workspace:^",
"lz4js": "^0.2.0"
}
}
14 changes: 14 additions & 0 deletions packages/hub/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hub/src/utils/WebBlob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class WebBlob extends Blob {

override slice(start = 0, end = this.size): WebBlob {
if (start < 0 || end < 0) {
new TypeError("Unsupported negative start/end on FileBlob.slice");
new TypeError("Unsupported negative start/end on WebBlob.slice");
}

const slice = new WebBlob(
Expand Down
17 changes: 17 additions & 0 deletions packages/hub/src/utils/XetBlob.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { describe, expect, it } from "vitest";
import { XetBlob } from "./XetBlob";

describe("XetBlob", () => {
it("should lazy load the first 22 bytes", async () => {
const blob = new XetBlob({
repo: {
type: "model",
name: "celinah/xet-experiments",
},
hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b",
size: 5_234_139_343,
});

expect(await blob.slice(10, 22).text()).toBe("__metadata__");
}, 30_000);
});
Loading
Loading