Skip to content

Commit

Permalink
Encode revision in remote URL (#507)
Browse files Browse the repository at this point in the history
Required to support accessing PRs on the HF Hub
  • Loading branch information
xenova authored Jan 10, 2024
1 parent 07df34f commit f6555dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
env.remoteHost,
env.remotePathTemplate
.replaceAll('{model}', path_or_repo_id)
.replaceAll('{revision}', revision),
.replaceAll('{revision}', encodeURIComponent(revision)),
filename
);

Expand Down

0 comments on commit f6555dc

Please sign in to comment.