# KeyError: zeroGPU comes up on using Gradio Load ()

**URL:** <https://discuss.huggingface.co/t/keyerror-zerogpu-comes-up-on-using-gradio-load/83647>\
**Category:** Spaces\
**Created:** [April 25, 2024, 4:41am UTC](https://discuss.huggingface.co/t/keyerror-zerogpu-comes-up-on-using-gradio-load/83647 "2024-04-25T04:41:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis1999super](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@louis1999super](https://discuss.huggingface.co/u/louis1999super)\
**Post date:** [April 25, 2024, 4:41am UTC](https://discuss.huggingface.co/t/keyerror-zerogpu-comes-up-on-using-gradio-load/83647/1 "2024-04-25T04:41:33Z")

</div>

Dears,

Hope you are doing well!

We came across an issue on using Gradio Load() access to a HF private space. The runtime error codes are as follows. This issue comes up from the new creation space and currently the same set of codes used in the spaces, which were created before 2024.04.20, seems still working.

File “/usr/local/lib/python3.10/site-packages/gradio/external.py”, line 60, in load  
return load\_blocks\_from\_repo(  
File “/usr/local/lib/python3.10/site-packages/gradio/external.py”, line 99, in load\_blocks\_from\_repo  
blocks: gradio.Blocks = factory\_methods[src](name, hf\_token, alias, \*\*kwargs)  
File “/usr/local/lib/python3.10/site-packages/gradio/external.py”, line 422, in from\_spaces  
return from\_spaces\_blocks(space=space\_name, hf\_token=hf\_token)  
File “/usr/local/lib/python3.10/site-packages/gradio/external.py”, line 454, in from\_spaces\_blocks  
return gradio.Blocks.from\_config(client.config, predict\_fns, client.src)  
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 853, in from\_config  
dependency.pop(“zerogpu”)  
KeyError: ‘zerogpu’

Here is the source code in the script as follows:

import os  
import gradio as gr  
read\_key = os.environ.get(‘hf\_space\_api\_key’)  
demo = gr.load(“hfname/private\_spacename1”, hf\_token=read\_key, src=“spaces”)  
demo.launch()

Looking forward to hearing advice, thank you in advance!

Terry

---

<div class="post-metadata">

**Author:** ![EmilyCarter01](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/emilycarter01/32/42173_2.png) [@EmilyCarter01](https://discuss.huggingface.co/u/EmilyCarter01)\
**Post date:** [February 28, 2025, 11:27am UTC](https://discuss.huggingface.co/t/keyerror-zerogpu-comes-up-on-using-gradio-load/83647/2 "2025-02-28T11:27:32Z")

</div>

This error typically means that ZeroGPU isn’t initialized properly within Gradio. Ensure the environment variables for device selection (CUDA\_VISIBLE\_DEVICES=0) and backend framework are correctly set. If running on a cloud instance, check if WebGPU support is available. Restarting the kernel or reloading dependencies (pip install --upgrade gradio) might resolve the issue.
