text: Title: Gradio Demo Malfunction on Hugging Face Spaces
  Body: ### Describe the bug
  
  Hi Team,
  
  We’ve been hosting a Gradio demo on Hugging Face Spaces (zero GPU) at [this link](https://huggingface.co/spaces/facebook/vggsfm), which has been running smoothly for several months. However, today a user reported that it’s no longer functioning. I’ve rebuilt the factory but it seems does not help. I checked the backend and retrieved the error logs as attached below.
  
  My best guess is that the version of Gradio on Hugging Face Spaces might have been updated, possibly leading to incompatibilities with the old version. The error logs are somewhat vague, making it difficult to pinpoint the exact issue. Is there any insight on resolving this, or could you point me towards the relevant documentation? It is much appreciated :)
  
  Best,
  Jianyuan
  
  ### Have you searched existing issues?  🔎
  
  - [x] I have searched and found no existing issues
  
  ### Reproduction
  
  https://huggingface.co/spaces/facebook/vggsfm/tree/main
  
  ### Screenshot
  
  _No response_
  
  ### Logs
  
  ```shell
  ZeroGPU tensors packing: 0.00B [00:00, ?B/s]
  ZeroGPU tensors packing: 0.00B [00:00, ?B/s]
  Running on local URL:  http://0.0.0.0:7860
  INFO:httpx:HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
  INFO:httpx:HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
  /usr/local/lib/python3.10/site-packages/gradio/blocks.py:2434: UserWarning: Setting share=True is not supported on Hugging Face Spaces
    warnings.warn(
  
  To create a public link, set `share=True` in `launch()`.
  INFO:httpx:HTTP Request: POST http://device-api.zero/schedule?cgroupPath=%2Fkubepods.slice%2Fkubepods-burstable.slice%2Fkubepods-burstable-pod1372a787_40e1_4b6a_8d19_2f4b46eca6e6.slice%2Fcri-containerd-edf0748ce7994c4de66b1374d62b458da7869fb7e8cf60b41a1dd4f939fa1c54.scope&taskId=140223021710736&enableQueue=true&durationSeconds=240&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpcCI6IjE2My4xMTQuMTMxLjEyOSIsInVzZXIiOiJKaWFueXVhbldhbmciLCJ1dWlkIjpudWxsLCJlcnJvciI6bnVsbCwiZXhwIjoxNzM3MTQ3MDczfQ.WQjeWxsjH1Fnj2DefdNZDKeDjKERP1tDwwXRWPk4w6E "HTTP/1.1 200 OK"
  INFO:httpx:HTTP Request: POST http://device-api.zero/allow?allowToken=9264c9602de0db756c3f6b1d2e9d1cab36b9b217010d3f1110b88b4ef3f646f6&pid=313 "HTTP/1.1 200 OK"
  INFO:httpx:HTTP Request: POST http://device-api.zero/release?allowToken=9264c9602de0db756c3f6b1d2e9d1cab36b9b217010d3f1110b88b4ef3f646f6&fail=true "HTTP/1.1 200 OK"
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 135, in worker_init
      torch.init(nvidia_uuid)
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/torch/patching.py", line 373, in init
      torch.Tensor([0]).cuda()
    File "/usr/local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 298, in _lazy_init
      torch._C._cuda_init()
  RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 304: OS call failed or operation not supported on this OS
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 532, in process_events
      response = await route_utils.call_process_api(
    File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
      output = await app.get_blocks().process_api(
    File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1928, in process_api
      result = await self.call_function(
    File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1514, in call_function
      prediction = await anyio.to_thread.run_sync(
    File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
      return await get_async_backend().run_sync_in_worker_thread(
    File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
      return await future
    File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
      result = context.run(func, *args)
    File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 832, in wrapper
      response = f(*args, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 214, in gradio_handler
      raise error("ZeroGPU worker error", res.error_cls)
  gradio.exceptions.Error: 'RuntimeError'
  INFO:httpx:HTTP Request: POST http://device-api.zero/schedule?cgroupPath=%2Fkubepods.slice%2Fkubepods-burstable.slice%2Fkubepods-burstable-pod1372a787_40e1_4b6a_8d19_2f4b46eca6e6.slice%2Fcri-containerd-edf0748ce7994c4de66b1374d62b458da7869fb7e8cf60b41a1dd4f939fa1c54.scope&taskId=140223021710736&enableQueue=true&durationSeconds=240&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpcCI6IjE2My4xMTQuMTMxLjEyOSIsInVzZXIiOiJKaWFueXVhbldhbmciLCJ1dWlkIjpudWxsLCJlcnJvciI6bnVsbCwiZXhwIjoxNzM3MTQ3MjU0fQ.E_mE7SO_dJKy00chpXUrF0QHwHzRUzWtCtTRjbdIPrA "HTTP/1.1 200 OK"
  INFO:httpx:HTTP Request: POST http://device-api.zero/allow?allowToken=ea91d23b086f5770c368d624fac358a31965f04141384f50a0eb2f42c892040e&pid=317 "HTTP/1.1 200 OK"
  INFO:httpx:HTTP Request: POST http://device-api.zero/release?allowToken=ea91d23b086f5770c368d624fac358a31965f04141384f50a0eb2f42c892040e&fail=true "HTTP/1.1 200 OK"
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 135, in worker_init
      torch.init(nvidia_uuid)
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/torch/patching.py", line 373, in init
      torch.Tensor([0]).cuda()
    File "/usr/local/lib/python3.10/site-packages/torch/cuda/__init__.py", line 298, in _lazy_init
      torch._C._cuda_init()
  RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 304: OS call failed or operation not supported on this OS
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 532, in process_events
      response = await route_utils.call_process_api(
    File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api
      output = await app.get_blocks().process_api(
    File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1928, in process_api
      result = await self.call_function(
    File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1514, in call_function
      prediction = await anyio.to_thread.run_sync(
    File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
      return await get_async_backend().run_sync_in_worker_thread(
    File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
      return await future
    File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
      result = context.run(func, *args)
    File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 832, in wrapper
      response = f(*args, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 214, in gradio_handler
      raise error("ZeroGPU worker error", res.error_cls)
  gradio.exceptions.Error: 'RuntimeError'
  ```
  
  ### System Info
  
  ```shell
  hugging face spaces, which seems to be using gradio version 4.36.1
  ```
  
  ### Severity
  
  Blocking usage of gradio