Skip to content

Commit 16181b0

Browse files
committed
our fetch polyfill does not have a body property on Response object
1 parent 57daf5f commit 16181b0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils/hub.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,13 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
557557
buffer = new Uint8Array(await response.arrayBuffer());
558558

559559
} else if (
560-
cacheHit // The item is being read from the cache
561-
&&
562-
typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) // We are in Firefox
560+
(
561+
cacheHit // The item is being read from the cache
562+
&&
563+
typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) // We are in Firefox
564+
) || (
565+
typeof response.body === 'undefined' // our fetch polyfill does not have a `body` property on `Response` object
566+
)
563567
) {
564568
// Due to bug in Firefox, we cannot display progress when loading from cache.
565569
// Fortunately, since this should be instantaneous, this should not impact users too much.

0 commit comments

Comments
 (0)