Skip to content

Commit 7b2c5ef

Browse files
committed
Remove duplicate check for mime_type
1 parent 0cfc191 commit 7b2c5ef

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)