diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index 13cf53fb..3cebd922 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -2310,9 +2310,18 @@ class HubApi: # Ignore .git .cache folders if ignore_patterns is None: - ignore_patterns = DEFAULT_IGNORE_PATTERNS + ignore_patterns = [] elif isinstance(ignore_patterns, str): ignore_patterns = [ignore_patterns] + ignore_patterns += DEFAULT_IGNORE_PATTERNS + + # Cover the ignore patterns if both allow and ignore patterns are provided + if allow_patterns is not None: + if '**' in allow_patterns: + ignore_patterns = [] + ignore_patterns = [ + p for p in ignore_patterns if p not in allow_patterns + ] commit_message = ( commit_message if commit_message is not None else f'Upload to {repo_id} on ModelScope hub'