Skip to content

Commit

Permalink
fix load oss files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceceliachenen committed Dec 23, 2024
1 parent a3171b9 commit 6a2cfc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pai_rag/utils/oss_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def list_objects(self, prefix: str):
"""
列出存储桶中指定前缀的对象列表。
该方法通过调用oss bucket的list_objects函数,查询与给定前缀匹配的所有对象,并返回这些对象的列表。
参数:
- prefix (str): 对象名的前缀,用于筛选满足条件的对象。默认为空字符串,表示不指定前缀,即列出所有对象。
返回:
- list: 包含满足前缀条件的所有对象的列表。
"""
# 调用bucket的list_objects方法,传入前缀参数
res = self.bucket.list_objects(prefix=prefix)
# 返回查询到的对象列表
return res.object_list
object_list = []
for obj in oss2.ObjectIterator(self.bucket, prefix):
logger.info("file: " + obj.key)
object_list.append(obj)
return object_list

def put_object_acl(self, key, permission):
if key.endswith(".txt"):
Expand Down

0 comments on commit 6a2cfc1

Please sign in to comment.