@@ -73,8 +73,8 @@ describe("XetBlob", () => {
73
73
}
74
74
) . then ( ( res ) => res . arrayBuffer ( ) ) ;
75
75
76
- expect ( new Uint8Array ( xetDownload ) ) . toEqual ( new Uint8Array ( bridgeDownload ) ) ;
77
76
expect ( xetDownload . byteLength ) . toBe ( 29929 ) ;
77
+ expect ( new Uint8Array ( xetDownload ) ) . toEqual ( new Uint8Array ( bridgeDownload ) ) ;
78
78
expect ( xorbCount ) . toBe ( 2 ) ;
79
79
} ) ;
80
80
@@ -112,32 +112,29 @@ describe("XetBlob", () => {
112
112
113
113
// In github actions, this test doesn't work inside the browser, but it works locally
114
114
// inside both chrome and chromium browsers
115
- // TODO: figure out why
116
- if ( typeof window === "undefined" && Math . random ( ) === 10 ) {
117
- it ( "should load correctly when loading far into a chunk range" , async ( ) => {
118
- const blob = new XetBlob ( {
119
- repo : {
120
- type : "model" ,
121
- name : "celinah/xet-experiments" ,
115
+ it ( "should load correctly when loading far into a chunk range" , async ( ) => {
116
+ const blob = new XetBlob ( {
117
+ repo : {
118
+ type : "model" ,
119
+ name : "celinah/xet-experiments" ,
120
+ } ,
121
+ hash : "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b" ,
122
+ size : 5_234_139_343 ,
123
+ } ) ;
124
+
125
+ const xetDownload = await blob . slice ( 10_000_000 , 10_100_000 ) . arrayBuffer ( ) ;
126
+ const bridgeDownload = await fetch (
127
+ "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors" ,
128
+ {
129
+ headers : {
130
+ Range : "bytes=10000000-10099999" ,
122
131
} ,
123
- hash : "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b" ,
124
- size : 5_234_139_343 ,
125
- } ) ;
126
-
127
- const xetDownload = await blob . slice ( 10_000_000 , 10_100_000 ) . arrayBuffer ( ) ;
128
- const bridgeDownload = await fetch (
129
- "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors" ,
130
- {
131
- headers : {
132
- Range : "bytes=10000000-10099999" ,
133
- } ,
134
- }
135
- ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
132
+ }
133
+ ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
136
134
137
- console . log ( "xet" , xetDownload . byteLength , "bridge" , bridgeDownload . byteLength ) ;
138
- expect ( new Uint8Array ( xetDownload ) ) . toEqual ( new Uint8Array ( bridgeDownload ) ) ;
139
- } , 30_000 ) ;
140
- }
135
+ console . log ( "xet" , xetDownload . byteLength , "bridge" , bridgeDownload . byteLength ) ;
136
+ expect ( new Uint8Array ( xetDownload ) ) . toEqual ( 100_000 ) ;
137
+ } , 30_000 ) ;
141
138
142
139
it ( "should load text correctly when offset_into_range starts in a chunk further than the first" , async ( ) => {
143
140
const blob = new XetBlob ( {
0 commit comments