File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,18 @@ describe("WebBlob", () => {
60
60
expect ( await webBlob . slice ( 10 , 22 ) . text ( ) ) . toBe ( "__metadata__" ) ;
61
61
} ) ;
62
62
63
+ it ( "should lazy load a Xet file hosted on Hugging Face" , async ( ) => {
64
+ const stableDiffusionUrl =
65
+ "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/unet/diffusion_pytorch_model.fp16.safetensors" ;
66
+ const url = new URL ( stableDiffusionUrl ) ;
67
+ const webBlob = await WebBlob . create ( url ) ;
68
+
69
+ expect ( webBlob . size ) . toBe ( 5_135_149_760 ) ;
70
+ expect ( webBlob ) . toBeInstanceOf ( WebBlob ) ;
71
+ expect ( webBlob ) . toMatchObject ( { url } ) ;
72
+ expect ( await webBlob . slice ( 10 , 22 ) . text ( ) ) . toBe ( "__metadata__" ) ;
73
+ } ) ;
74
+
63
75
it ( "should create a slice on the file" , async ( ) => {
64
76
const expectedText = fullText . slice ( 10 , 20 ) ;
65
77
You can’t perform that action at this time.
0 commit comments