提交 8dd7e46c 编写于 作者: W wuzewu

Fix regular matching bug

上级 e2064c02
......@@ -30,7 +30,7 @@ class SearchCommand(BaseCommand):
def __init__(self, name):
super(SearchCommand, self).__init__(name)
self.show_in_help = True
self.description = "Search PaddleHub pretrained model through model keywords"
self.description = "Search PaddleHub pretrained model through model keywords."
self.parser = self.parser = argparse.ArgumentParser(
description=self.__class__.__doc__,
prog='%s %s <key>' % (ENTRY, name),
......
......@@ -75,7 +75,7 @@ class HubServer(object):
match_resource_index_list = []
for index, resource in enumerate(self.resource_list_file['name']):
try:
is_match = re.match(resource_key, resource)
is_match = re.search(resource_key, resource)
if is_match and (resource_type is None
or self.resource_list_file['type'][index] ==
resource_type):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册