cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

Gemini API: Prompting with Video - genai.upload_file [Errno 60] Operation timed out

Open maxuechaogao opened this issue 10 months ago • 3 comments

image image

maxuechaogao avatar Apr 17 '24 03:04 maxuechaogao

How should I handle it so that I can execute the function to upload files locally? Additionally, what does this function correspond to 【POST https://generativelanguage.googleapis.com/upload/v1beta/files】?

maxuechaogao avatar Apr 17 '24 03:04 maxuechaogao

Hi, are you running this in an available region by the way? Seems like this might be related to the other issue: https://github.com/google-gemini/cookbook/issues/72

TYMichaelChen avatar Apr 17 '24 14:04 TYMichaelChen

Hi, are you running this in an available region by the way? Seems like this might be related to the other issue: #72 Yes, I am using a US node

maxuechaogao avatar Apr 18 '24 04:04 maxuechaogao

the same proble,genai.upload_file time out.

garmanwu avatar Apr 20 '24 03:04 garmanwu

I find the solution.

Make sure Audio.ipynb works fine. That means the server end is OK. https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Audio.ipynb

The error happens in the network connection even you change the VPN node. You can set python code as below: os.environ['http_proxy']='http://127.0.0.1:7890' os.environ['https_proxy']='http://127.0.0.1:7890' os.environ['all_proxy']='socks5://127.0.0.1:7890' genai.configure(api_key=GOOGLE_API_KEY,transport='rest')

It works fine for me. Good luck~

garmanwu avatar Apr 20 '24 13:04 garmanwu

I find the solution.

Make sure Audio.ipynb works fine. That means the server end is OK. https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Audio.ipynb

The error happens in the network connection even you change the VPN node. You can set python code as below: os.environ['http_proxy']='http://127.0.0.1:7890' os.environ['https_proxy']='http://127.0.0.1:7890' os.environ['all_proxy']='sock5://127.0.0.1:7890' genai.configure(api_key=GOOGLE_API_KEY,transport='rest')

It works fine for me. Good luck~

Thank you very much. This configuration is indeed feasible

maxuechaogao avatar Apr 23 '24 06:04 maxuechaogao

I find the solution.

Make sure Audio.ipynb works fine. That means the server end is OK. https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Audio.ipynb

The error happens in the network connection even you change the VPN node. You can set python code as below: os.environ['http_proxy']='http://127.0.0.1:7890' os.environ['https_proxy']='http://127.0.0.1:7890' os.environ['all_proxy']='socks5://127.0.0.1:7890' genai.configure(api_key=GOOGLE_API_KEY,transport='rest')

It works fine for me. Good luck~

Works for me. thx a lot 😀 By the way, genai is not supported in HongKong, that's sad😅

wangy325 avatar Jul 06 '24 17:07 wangy325