mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 04:01:10 +01:00
add print(..., flush=True) for cli
This commit is contained in:
@@ -1481,7 +1481,7 @@ class HubApi:
|
||||
repo,
|
||||
'configuration.json', [json.dumps(config)],
|
||||
ignore_push_error=True)
|
||||
logger.info(f'New model created successfully at {repo_url}.')
|
||||
print(f'New model created successfully at {repo_url}.', flush=True)
|
||||
|
||||
elif repo_type == REPO_TYPE_DATASET:
|
||||
visibilities = {k: v for k, v in DatasetVisibility.__dict__.items() if not k.startswith('__')}
|
||||
@@ -1496,7 +1496,7 @@ class HubApi:
|
||||
license=license,
|
||||
visibility=visibility,
|
||||
)
|
||||
logger.info(f'New dataset created successfully at {repo_url}.')
|
||||
print(f'New dataset created successfully at {repo_url}.', flush=True)
|
||||
|
||||
else:
|
||||
raise ValueError(f'Invalid repo type: {repo_type}, supported repos: {REPO_TYPE_SUPPORT}')
|
||||
@@ -1638,7 +1638,7 @@ class HubApi:
|
||||
add_operation._is_uploaded = upload_res['is_uploaded']
|
||||
operations = [add_operation]
|
||||
|
||||
logger.info(f'Committing file to {repo_id} ...')
|
||||
print(f'Committing file to {repo_id} ...', flush=True)
|
||||
commit_info: CommitInfo = self.create_commit(
|
||||
repo_id=repo_id,
|
||||
operations=operations,
|
||||
@@ -1762,7 +1762,7 @@ class HubApi:
|
||||
opt._is_uploaded = is_uploaded
|
||||
operations.append(opt)
|
||||
|
||||
logger.info(f'Committing folder to {repo_id} ...')
|
||||
print(f'Committing folder to {repo_id} ...', flush=True)
|
||||
commit_info: CommitInfo = self.create_commit(
|
||||
repo_id=repo_id,
|
||||
operations=operations,
|
||||
|
||||
Reference in New Issue
Block a user