Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个拉取请求包含对
swanlab/api/cos.py
文件的重大更新,主要集中在将云对象存储操作从腾讯云 COS SDK 迁移到 AWS Boto3 SDK。最重要的更改包括更新导入、修改初始化方法以及重构上传方法。迁移到 AWS Boto3 SDK:
swanlab/api/cos.py
:将腾讯云 COS SDK 的导入(CosConfig
、CosS3Client
、SimpleThreadPool
)替换为 AWS Boto3 SDK 的导入(boto3
、BotocoreConfig
、ThreadPoolExecutor
)。初始化方法更新:
swanlab/api/cos.py
:更新了__init__
方法,使用 Boto3 初始化 S3 客户端,并配置了适当的凭证和配置。重构上传方法:
swanlab/api/cos.py
:修改了upload
方法,移除了EnableMD5
参数,因为 Boto3 不支持该参数。swanlab/api/cos.py
:重构了upload_files
方法,使用ThreadPoolExecutor
进行并发上传,而不是SimpleThreadPool
。其他改进:
swanlab/api/cos.py
:在should_refresh
属性中添加了一个FIXME
注释,建议使用时区感知对象来表示 UTC 时间。close #767