fix(kreuzberg): fix 'read of closed file' error by reading file content before requests
This commit is contained in:
@@ -73,8 +73,10 @@ class Tools:
|
|||||||
mime_type = mime_type or 'application/octet-stream'
|
mime_type = mime_type or 'application/octet-stream'
|
||||||
|
|
||||||
with open(file_path, 'rb') as f:
|
with open(file_path, 'rb') as f:
|
||||||
|
file_content = f.read()
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
'files': (os.path.basename(file_path), f, mime_type)
|
'files': (os.path.basename(file_path), io.BytesIO(file_content), mime_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user