Skip to content

Commit a21a8c0

Browse files
committed
Merge branch 'stream-file-upload' of https://github.com/Hamza-nabil/generative-ai-python into stream-file-upload
Change-Id: Ib1a9ffcbad13ddecaca2350850101e7c0b74840a
2 parents a3a005a + 7b2c5ef commit a21a8c0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

google/generativeai/files.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ def upload_file(
7474
mime_type, _ = mimetypes.guess_type(path)
7575

7676
if mime_type is None:
77-
if mime_type is None:
78-
raise ValueError(
79-
"Unknown mime type: Could not determine the mimetype for your file\n"
80-
" please set the `mime_type` argument"
81-
)
77+
raise ValueError(
78+
"Unknown mime type: Could not determine the mimetype for your file\n"
79+
" please set the `mime_type` argument"
80+
)
8281

8382
if name is not None and "/" not in name:
8483
name = f"files/{name}"

0 commit comments

Comments
 (0)