mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +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