fix
Browse filesFiles changed (2)
5 unmodified lines678910111213141516171819202122232425262728295 unmodified linesimport gradio as grfrom typing import Dict, Optionalfrom huggingface_hub import HfApiimport httpx
# Monkey-patch httpx to increase timeout for OAuth# This prevents ReadTimeout errors during HuggingFace OAuth flow_original_client_init = httpx.AsyncClient.__init__
def _patched_client_init(self, *args, **kwargs): # If no timeout is specified, use longer timeouts if 'timeout' not in kwargs: kwargs['timeout'] = httpx.Timeout( connect=30.0, # 30 seconds for connection read=60.0, # 60 seconds for reading response (increased from default 5s) write=30.0, # 30 seconds for writing pool=30.0 # 30 seconds for pool operations ) return _original_client_init(self, *args, **kwargs)
httpx.AsyncClient.__init__ = _patched_client_init
from .config import ( AVAILABLE_MODELS, DEFAULT_MODEL, DEFAULT_MODEL_NAME,1234567git+https://github.com/huggingface/huggingface_hub.gitgradio[oauth]fastapi==0.112.2httpx>=0.27.0PyPDF2python-docxpytesseractanycoder_app/ui.py+18
requirements.txt+2