Failed to upload file with error 500

I was trying to run the https://github.com/google-gemini/cookbook/blob/main/examples/Sherlock_Jr.ipynb code in Google Colab, so I just clicked “Run in Google Colab” and setup the API key in the Google Colab secrets. Then I just started running each block of code, one by one, starting with the

!pip install -U -q google-generativeai

Everything went well with no errors until I reached the 5th block, this code:

video_file_name = "Sherlock_Jr_FullMovie.mp4"

print(f"Uploading file...")
video_file = genai.upload_file(path=video_file_name)
print(f"Completed upload: {video_file.uri}")

When I attempted to run it, this error happened:

Hi @Mino_F16,

That’s interesting to hear about the trouble running the cookbook example. On my end, I was able to run it successfully without any issues. Please find the screenshot for reference. Thank you.

1 Like