Skip to content

Commit cb1e6c1

Browse files
committed
update comments
1 parent 16181b0 commit cb1e6c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/utils/hub.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,16 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
558558

559559
} else if (
560560
(
561+
// Due to bug in Firefox, we cannot display progress when loading from cache.
562+
// Fortunately, since this should be instantaneous, this should not impact users too much.
561563
cacheHit // The item is being read from the cache
562564
&&
563565
typeof navigator !== 'undefined' && /firefox/i.test(navigator.userAgent) // We are in Firefox
564566
) || (
565-
typeof response.body === 'undefined' // our fetch polyfill does not have a `body` property on `Response` object
567+
// The `body` property may not be available on a `Response` object, e.g., when using a fetch polyfill
568+
typeof response.body === 'undefined'
566569
)
567570
) {
568-
// Due to bug in Firefox, we cannot display progress when loading from cache.
569-
// Fortunately, since this should be instantaneous, this should not impact users too much.
570571
buffer = new Uint8Array(await response.arrayBuffer());
571572

572573
// For completeness, we still fire the final progress callback

0 commit comments

Comments
 (0)