From ede27970ecdb2e4475afad49f711585ac6b86b42 Mon Sep 17 00:00:00 2001 From: Bumsik Kim Date: Mon, 9 Jan 2023 00:24:38 +0000 Subject: [PATCH] [Fix] decode URL encoded string in config path Some packages has config paths which is url encoded (e.g. %2B for +) https://github.com/open-mmlab/mmdetection/blob/db85fd12afce2fe89d1c7b870874c02a90018a16/configs/gn%2Bws/metafile.yml#L17 Currently downloading those models trrigers "is not found" error because mim does not support url encoded path. While I am not sure if this should be fixed in mim or in metafile.yml in the package, I firstly attempt to fix in mim package. --- mim/commands/download.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mim/commands/download.py b/mim/commands/download.py index a49921a..6f9ea58 100644 --- a/mim/commands/download.py +++ b/mim/commands/download.py @@ -2,6 +2,7 @@ import os import os.path as osp from typing import List, Optional +from urllib.parse import unquote import click @@ -132,6 +133,7 @@ def download(package: str, config_paths = model_info[config]['config'] for config_path in config_paths.split(','): + config_path = unquote(config_path) installed_path = get_installed_path(package) # configs will be put in package/.mim in PR #68 possible_config_paths = [