You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/gradio_client/client.py", line 277, in stream_messages
self.pending_event_ids.remove(event_id)
KeyError: 'a4306ceb969b452f8b4e2d6de58cd88f'
Hi, a httpx.ReadTimeout during client.predict() might prevent self.client.pending_event_ids.add(event_id) from executing in make_predict().
This results in a missing event_id in pending_event_ids, causing the KeyError when stream_messages() attempts removal.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
fromtimeimportsleepimporthttpxfromgradio_clientimportClientclient=Client(SPACE_NAME, HF_TOKEN)
whileTrue:
try:
result=client.predict(
state="0",
api_name="/check_status"
)
ifresult:
breakelse:
sleep(60)
continueexcept (httpx.ReadTimeout, httpx.ConnectError) asexc:
print('this line executed when httpx.ReadTimeout')
sleep(60)
continueexceptExceptionasexc:
print('this line executed when pending_event_ids KeyError')
break
Screenshot
No response
Logs
No response
System Info
print(gradio_client.__version__)
1.5.2
Severity
I can work around it
The text was updated successfully, but these errors were encountered:
Describe the bug
Hi, a
httpx.ReadTimeout
duringclient.predict()
might preventself.client.pending_event_ids.add(event_id)
from executing inmake_predict()
.This results in a missing
event_id
inpending_event_ids
, causing theKeyError
whenstream_messages()
attempts removal.Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: