text: Title: [ Gradio Client ] Handling a local audio file. ReadTimeout: The read operation timed out.
  Body: Hello, 
  
  I'm following the tutorial to run the whisper example on the documentation with a local file. However, I'm having a couple of errors. 
  
  
  I'm using gradio_client `1.5.4`, but I tried `1.5.0` and `1.4.3`. The same behaviour persists. Probably, this isn't a bug, but rather I'm using badly the API. Sorry if so.
  
  **A.** When following the example published [here](https://www.gradio.app/docs/python-client/introduction), it works when the file is hosted. However, when I try to the same with a local file I can't receive the correct output using a local file.
  
  ```python
  from gradio_client import Client, handle_file
  
  client = Client("abidlabs/whisper")
  
  results = client.predict(
      #audio=handle_file('https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav')
      audio=handle_file('test.wav')
  )
  results
  ```
  
  Output with local file
  ```
  Loaded as API: https://abidlabs-whisper.hf.space/ ✔
  ('/tmp/gradio/45665c644e65fc9edcad2a47be86e9a8c33c813652125c7cb039d4461a3c1168/test.wav',)
  ```
  
  Output with github hosted file
  ```
  Loaded as API: https://abidlabs-whisper.hf.space/ ✔
  you
  ```
  
  
  
  **B.** I created a more complex radio app I'm sharing from my PC. When I use it via the GUI on gradio.live, there's no problem. However, if I attempt to use it via `gradio_client`, I obtain the following ReadTimeout error.
  
  ```
  ---------------------------------------------------------------------------
  ReadTimeout                               Traceback (most recent call last)
  [/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py](https://localhost:8080/#) in map_httpcore_exceptions()
      100     try:
  --> 101         yield
      102     except Exception as exc:
  
  29 frames
  [/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py](https://localhost:8080/#) in handle_request(self, request)
      249         with map_httpcore_exceptions():
  --> 250             resp = self._pool.handle_request(req)
      251 
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection_pool.py](https://localhost:8080/#) in handle_request(self, request)
      255             self._close_connections(closing)
  --> 256             raise exc from None
      257 
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection_pool.py](https://localhost:8080/#) in handle_request(self, request)
      235                     # Send the request on the assigned connection.
  --> 236                     response = connection.handle_request(
      237                         pool_request.request
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/connection.py](https://localhost:8080/#) in handle_request(self, request)
      102 
  --> 103         return self._connection.handle_request(request)
      104 
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py](https://localhost:8080/#) in handle_request(self, request)
      135                     self._response_closed()
  --> 136             raise exc
      137 
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py](https://localhost:8080/#) in handle_request(self, request)
      105                     trailing_data,
  --> 106                 ) = self._receive_response_headers(**kwargs)
      107                 trace.return_value = (
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py](https://localhost:8080/#) in _receive_response_headers(self, request)
      176         while True:
  --> 177             event = self._receive_event(timeout=timeout)
      178             if isinstance(event, h11.Response):
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_sync/http11.py](https://localhost:8080/#) in _receive_event(self, timeout)
      216             if event is h11.NEED_DATA:
  --> 217                 data = self._network_stream.read(
      218                     self.READ_NUM_BYTES, timeout=timeout
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_backends/sync.py](https://localhost:8080/#) in read(self, max_bytes, timeout)
      125         exc_map: ExceptionMapping = {socket.timeout: ReadTimeout, OSError: ReadError}
  --> 126         with map_exceptions(exc_map):
      127             self._sock.settimeout(timeout)
  
  [/usr/lib/python3.11/contextlib.py](https://localhost:8080/#) in __exit__(self, typ, value, traceback)
      157             try:
  --> 158                 self.gen.throw(typ, value, traceback)
      159             except StopIteration as exc:
  
  [/usr/local/lib/python3.11/dist-packages/httpcore/_exceptions.py](https://localhost:8080/#) in map_exceptions(map)
       13             if isinstance(exc, from_exc):
  ---> 14                 raise to_exc(exc) from exc
       15         raise  # pragma: nocover
  
  ReadTimeout: The read operation timed out
  
  The above exception was the direct cause of the following exception:
  
  ReadTimeout                               Traceback (most recent call last)
  [<ipython-input-8-97f4f20faa6a>](https://localhost:8080/#) in <cell line: 0>()
  ----> 1 job.result()
  
  [/usr/local/lib/python3.11/dist-packages/gradio_client/client.py](https://localhost:8080/#) in result(self, timeout)
     1512             >> 9
     1513         """
  -> 1514         return super().result(timeout=timeout)
     1515 
     1516     def outputs(self) -> list[tuple | Any]:
  
  [/usr/lib/python3.11/concurrent/futures/_base.py](https://localhost:8080/#) in result(self, timeout)
      447                     raise CancelledError()
      448                 elif self._state == FINISHED:
  --> 449                     return self.__get_result()
      450 
      451                 self._condition.wait(timeout)
  
  [/usr/lib/python3.11/concurrent/futures/_base.py](https://localhost:8080/#) in __get_result(self)
      399         if self._exception:
      400             try:
  --> 401                 raise self._exception
      402             finally:
      403                 # Break a reference cycle with the exception in self._exception
  
  [/usr/lib/python3.11/concurrent/futures/thread.py](https://localhost:8080/#) in run(self)
       56 
       57         try:
  ---> 58             result = self.fn(*self.args, **self.kwargs)
       59         except BaseException as exc:
       60             self.future.set_exception(exc)
  
  [/usr/local/lib/python3.11/dist-packages/gradio_client/client.py](https://localhost:8080/#) in _inner(*data)
     1130 
     1131             data = self.insert_empty_state(*data)
  -> 1132             data = self.process_input_files(*data)
     1133             predictions = _predict(*data)
     1134             predictions = self.process_predictions(*predictions)
  
  [/usr/local/lib/python3.11/dist-packages/gradio_client/client.py](https://localhost:8080/#) in process_input_files(self, *data)
     1285         data_ = []
     1286         for i, d in enumerate(data):
  -> 1287             d = utils.traverse(
     1288                 d,
     1289                 partial(self._upload_file, data_index=i),
  
  [/usr/local/lib/python3.11/dist-packages/gradio_client/utils.py](https://localhost:8080/#) in traverse(json_obj, func, is_root)
      998     """
      999     if is_root(json_obj):
  -> 1000         return func(json_obj)
     1001     elif isinstance(json_obj, dict):
     1002         new_obj = {}
  
  [/usr/local/lib/python3.11/dist-packages/gradio_client/client.py](https://localhost:8080/#) in _upload_file(self, f, data_index)
     1357             with open(file_path, "rb") as f:
     1358                 files = [("files", (orig_name.name, f))]
  -> 1359                 r = httpx.post(
     1360                     self.client.upload_url,
     1361                     headers=self.client.headers,
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_api.py](https://localhost:8080/#) in post(url, content, data, files, json, params, headers, cookies, auth, proxy, follow_redirects, verify, timeout, trust_env)
      302     **Parameters**: See `httpx.request`.
      303     """
  --> 304     return request(
      305         "POST",
      306         url,
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_api.py](https://localhost:8080/#) in request(method, url, params, content, data, files, json, headers, cookies, auth, proxy, timeout, follow_redirects, verify, trust_env)
      107         trust_env=trust_env,
      108     ) as client:
  --> 109         return client.request(
      110             method=method,
      111             url=url,
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_client.py](https://localhost:8080/#) in request(self, method, url, content, data, files, json, params, headers, cookies, auth, follow_redirects, timeout, extensions)
      823             extensions=extensions,
      824         )
  --> 825         return self.send(request, auth=auth, follow_redirects=follow_redirects)
      826 
      827     @contextmanager
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_client.py](https://localhost:8080/#) in send(self, request, stream, auth, follow_redirects)
      912         auth = self._build_request_auth(request, auth)
      913 
  --> 914         response = self._send_handling_auth(
      915             request,
      916             auth=auth,
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_client.py](https://localhost:8080/#) in _send_handling_auth(self, request, auth, follow_redirects, history)
      940 
      941             while True:
  --> 942                 response = self._send_handling_redirects(
      943                     request,
      944                     follow_redirects=follow_redirects,
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_client.py](https://localhost:8080/#) in _send_handling_redirects(self, request, follow_redirects, history)
      977                 hook(request)
      978 
  --> 979             response = self._send_single_request(request)
      980             try:
      981                 for hook in self._event_hooks["response"]:
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_client.py](https://localhost:8080/#) in _send_single_request(self, request)
     1012 
     1013         with request_context(request=request):
  -> 1014             response = transport.handle_request(request)
     1015 
     1016         assert isinstance(response.stream, SyncByteStream)
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py](https://localhost:8080/#) in handle_request(self, request)
      247             extensions=request.extensions,
      248         )
  --> 249         with map_httpcore_exceptions():
      250             resp = self._pool.handle_request(req)
      251 
  
  [/usr/lib/python3.11/contextlib.py](https://localhost:8080/#) in __exit__(self, typ, value, traceback)
      156                 value = typ()
      157             try:
  --> 158                 self.gen.throw(typ, value, traceback)
      159             except StopIteration as exc:
      160                 # Suppress StopIteration *unless* it's the same exception that
  
  [/usr/local/lib/python3.11/dist-packages/httpx/_transports/default.py](https://localhost:8080/#) in map_httpcore_exceptions()
      116 
      117         message = str(exc)
  --> 118         raise mapped_exc(message) from exc
      119 
      120 
  
  ReadTimeout: The read operation timed out
  ```
  
  Thanks in advance.
  
  ### Have you searched existing issues?  🔎
  
  - [x] I have searched and found no existing issues
  
  ### Reproduction
  
  This is the code for the first attempt with whisper:
  
  ```python
  from gradio_client import Client, handle_file
  
  client = Client("abidlabs/whisper")
  
  results = client.predict(
      audio=handle_file('test.wav')
  )
  results
  
  ```
  
  This is the code for my gradio local app. I'll keep it open for some time.
  
  ```
  from gradio_client import Client, handle_file
  
  client = Client("https://bc3c5d74ec992db205.gradio.live")
  
  audio_file = handle_file("/content/test.wav")
  
  result = client.predict(
      audio_file=audio_file,  # Local file named "audio.wav"
      model="base",                        # Whisper model: "tiny", "base", "small", "medium", "large", or "large-v2"
      task="transcribe",                   # Task: "transcribe" or "translate"
      language="auto",                     # Source language: "auto", "en", "es", etc.
      api_name="/process_audio"            # The Gradio endpoint name
  )
  ```
  
  
  ### Screenshot
  
  _No response_
  
  ### Logs
  
  ```shell
  
  ```
  
  ### System Info
  
  ```shell
  It says `gradio_client` is not installed. But it's actually. 
  
  
  Gradio Environment Information:
  ------------------------------
  Operating System: Linux
  gradio version: 5.12.0
  gradio_client version: 1.5.4
  
  ------------------------------------------------
  gradio dependencies in your environment:
  
  aiofiles: 23.2.1
  anyio: 3.7.1
  audioop-lts is not installed.
  fastapi: 0.115.6
  ffmpy: 0.5.0
  gradio-client==1.5.4 is not installed.
  httpx: 0.28.1
  huggingface-hub: 0.27.1
  jinja2: 3.1.5
  markupsafe: 2.1.5
  numpy: 1.26.4
  orjson: 3.10.14
  packaging: 24.2
  pandas: 2.2.2
  pillow: 11.1.0
  pydantic: 2.10.5
  pydub: 0.25.1
  python-multipart: 0.0.20
  pyyaml: 6.0.2
  ruff: 0.9.2
  safehttpx: 0.1.6
  semantic-version: 2.10.0
  starlette: 0.41.3
  tomlkit: 0.13.2
  typer: 0.15.1
  typing-extensions: 4.12.2
  urllib3: 2.3.0
  uvicorn: 0.34.0
  authlib; extra == 'oauth' is not installed.
  itsdangerous; extra == 'oauth' is not installed.
  
  
  gradio_client dependencies in your environment:
  
  fsspec: 2024.10.0
  httpx: 0.28.1
  huggingface-hub: 0.27.1
  packaging: 24.2
  typing-extensions: 4.12.2
  websockets: 14.1
  ```
  
  ### Severity
  
  Blocking usage of gradio