mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 19:27:48 +08:00
fix tencent_cos_storage image-preview error is not a byte (#6652)
This commit is contained in:
parent
a876baf0a9
commit
349ec0db77
@ -32,8 +32,7 @@ class TencentStorage(BaseStorage):
|
||||
def load_stream(self, filename: str) -> Generator:
|
||||
def generate(filename: str = filename) -> Generator:
|
||||
response = self.client.get_object(Bucket=self.bucket_name, Key=filename)
|
||||
while chunk := response['Body'].get_stream(chunk_size=4096):
|
||||
yield chunk
|
||||
yield from response['Body'].get_stream(chunk_size=4096)
|
||||
|
||||
return generate()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user