|
1 | 1 | import { describe, expect, it, beforeAll } from "vitest";
|
2 | 2 | import { WebBlob } from "./WebBlob";
|
3 |
| -import { base64FromBytes } from "./base64FromBytes"; |
4 | 3 |
|
5 | 4 | describe("WebBlob", () => {
|
6 | 5 | const resourceUrl = new URL("https://huggingface.co/spaces/aschen/push-model-from-web/raw/main/mobilenet/model.json");
|
@@ -51,15 +50,14 @@ describe("WebBlob", () => {
|
51 | 50 |
|
52 | 51 | it("should lazy load a LFS file hosted on Hugging Face", async () => {
|
53 | 52 | 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"; |
55 | 54 | const url = new URL(stableDiffusionUrl);
|
56 | 55 | const webBlob = await WebBlob.create(url);
|
57 | 56 |
|
58 |
| - expect(webBlob.size).toBe(7_703_324_286); |
| 57 | + expect(webBlob.size).toBe(5_135_149_760); |
59 | 58 | expect(webBlob).toBeInstanceOf(WebBlob);
|
60 | 59 | 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__"); |
63 | 61 | });
|
64 | 62 |
|
65 | 63 | it("should create a slice on the file", async () => {
|
|
0 commit comments