Skip to content

Commit

Permalink
Merge branch 'merge' into bricks
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Jun 18, 2024
2 parents fa011ca + 9109355 commit a9f369c
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/utils/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -892,18 +892,16 @@ export async function getModelPath(path_or_repo_id, filename, fatal = true, opti
file: filename
}

if (response === undefined) {
const cachePath = path.join(options.cache_dir ?? env.cacheDir, proposedCacheKey);
await downloadFile(remoteURL, cachePath, data => {
dispatchCallback(options.progress_callback, {
...progressInfo,
...data,
})
});
response = await getFile(cachePath);
if (response.status !== 200) {
return handleError(response.status, remoteURL, fatal);
}
const cachePath = path.join(options.cache_dir ?? env.cacheDir, proposedCacheKey);
await downloadFile(remoteURL, cachePath, data => {
dispatchCallback(options.progress_callback, {
...progressInfo,
...data,
})
});
response = await getFile(cachePath);
if (response.status !== 200) {
return handleError(response.status, remoteURL, fatal);
}

dispatchCallback(options.progress_callback, {
Expand Down

0 comments on commit a9f369c

Please sign in to comment.