Timeout issue #2824
-
I'm developing a Gradio based application. I need to use My application uses machine learning model inference which takes more than 7-8 seconds sometimes. Issue: When I change this line to 10 seconds, it works fine. How can we overwrite this value? Is there any fix? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
Hi! You don't have access to the httpx client, but you'd like to change the timeout, correct? Could you please provide more information and possibly some code examples so that we can better understand your problem? |
Beta Was this translation helpful? Give feedback.
-
@karosis88
This prints on console that DEFAULT_TIMEOUT_CONFIG = 30.0 When I run my application, I still get the timeout issue. |
Beta Was this translation helpful? Give feedback.
-
I don't think it's a reliable solution; instead, find some api that allows you to change the client's timeout. In your case, httpx client is used by "googletrans" library, right? |
Beta Was this translation helpful? Give feedback.
-
yes, "googletrans" library uses httpx client. I've found something like this from here:
But not working out. For this, I need to make changes inside googletrans lib. Not feasible. |
Beta Was this translation helpful? Give feedback.
-
If you do this before importing the "googletrans" library, your example should work. |
Beta Was this translation helpful? Give feedback.
-
Alternatively, you can import that library, then find the client if it's globally defined and change the timeout property. |
Beta Was this translation helpful? Give feedback.
-
Only solution for now I see is manually update this line with higher number. |
Beta Was this translation helpful? Give feedback.
Try this
Worked for me