Skip to content

Commit be261ff

Browse files
authored
Fix WBlob test (#895)
Fixes #894
1 parent 4959181 commit be261ff

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/hub/src/utils/WebBlob.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { describe, expect, it, beforeAll } from "vitest";
22
import { WebBlob } from "./WebBlob";
3-
import { base64FromBytes } from "./base64FromBytes";
43

54
describe("WebBlob", () => {
65
const resourceUrl = new URL("https://huggingface.co/spaces/aschen/push-model-from-web/raw/main/mobilenet/model.json");
@@ -51,15 +50,14 @@ describe("WebBlob", () => {
5150

5251
it("should lazy load a LFS file hosted on Hugging Face", async () => {
5352
const stableDiffusionUrl =
54-
"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/39593d5650112b4cc580433f6b0435385882d819/v1-5-pruned.safetensors";
53+
"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/unet/diffusion_pytorch_model.fp16.safetensors";
5554
const url = new URL(stableDiffusionUrl);
5655
const webBlob = await WebBlob.create(url);
5756

58-
expect(webBlob.size).toBe(7_703_324_286);
57+
expect(webBlob.size).toBe(5_135_149_760);
5958
expect(webBlob).toBeInstanceOf(WebBlob);
6059
expect(webBlob).toMatchObject({ url });
61-
expect(base64FromBytes(new Uint8Array(await webBlob.slice(6, 12).arrayBuffer()))).toBe("AAB7Il9f");
62-
expect(base64FromBytes(new Uint8Array(await webBlob.slice(0, 12).arrayBuffer()))).toBe("ytIDAAAAAAB7Il9f");
60+
expect(await webBlob.slice(10, 22).text()).toBe("__metadata__");
6361
});
6462

6563
it("should create a slice on the file", async () => {

0 commit comments

Comments
 (0)