Skip to content

Commit

Permalink
fix zenodo file download
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 20, 2023
1 parent ea70f3d commit d75f82b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ private void unzipTfWeights() throws IOException {
* @throws MalformedURLException if the String does not correspond to an URL
*/
public static String getFileNameFromURLString(String str) throws MalformedURLException {
if (str.startsWith("https://zenodo.org/"))
str = str.substring(0, str.length() - "/content".length());
URL url = new URL(str);
return new File(url.getPath()).getName();
}
Expand Down

0 comments on commit d75f82b

Please sign in to comment.