mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 04:01:10 +01:00
Fix/upload patterns (#1567)
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user