Skip to content

Commit

Permalink
Fix webBlob test (use LFS file as example instead of Xet file) (#1230)
Browse files Browse the repository at this point in the history
CI currently fails with:

```
packages/hub test:browser: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
packages/hub test:browser:  FAIL  src/utils/WebBlob.spec.ts > WebBlob > should lazy load a LFS file hosted on Hugging Face
packages/hub test:browser: Error: Test timed out in 5000ms.
packages/hub test:browser: If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
packages/hub test:browser: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
```

PR expectation: CI is green.

See
#1230 (comment)
and
#1230 (comment)
for explanation.
  • Loading branch information
Wauplin authored Feb 26, 2025
1 parent 80cf756 commit 51ef023
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/hub/src/utils/WebBlob.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ describe("WebBlob", () => {
});

it("should lazy load a LFS file hosted on Hugging Face", async () => {
const stableDiffusionUrl =
"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/unet/diffusion_pytorch_model.fp16.safetensors";
const url = new URL(stableDiffusionUrl);
const zephyrUrl =
"https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha/resolve/main/model-00001-of-00008.safetensors";
const url = new URL(zephyrUrl);
const webBlob = await WebBlob.create(url);

expect(webBlob.size).toBe(5_135_149_760);
expect(webBlob.size).toBe(1_889_587_040);
expect(webBlob).toBeInstanceOf(WebBlob);
expect(webBlob).toMatchObject({ url });
expect(await webBlob.slice(10, 22).text()).toBe("__metadata__");
Expand Down

0 comments on commit 51ef023

Please sign in to comment.