yetessam commited on
Commit
a6d6fb8
·
verified ·
1 Parent(s): 60041b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -48,9 +48,12 @@ def initialize_agent(endpoint_uri: str):
48
  )
49
 
50
 
51
- def wake_up_endpoint(endpoint_uri, ui, max_wait=30):
52
  """Poll the endpoint until it responds OK or timeout."""
53
 
 
 
 
54
  # Get token from environment variable or secrets store
55
  hf_token = os.environ.get("HF_TOKEN") # Or replace with your secret loading logic
56
  headers = {"Authorization": f"Bearer {hf_token}"} if hf_token else {}
 
48
  )
49
 
50
 
51
+ def wake_up_endpoint(endpoint_uri, ui, max_wait=300):
52
  """Poll the endpoint until it responds OK or timeout."""
53
 
54
+
55
+ # Enforce minimum wait time of 60 seconds
56
+ max_wait = max(max_wait, 60)
57
  # Get token from environment variable or secrets store
58
  hf_token = os.environ.get("HF_TOKEN") # Or replace with your secret loading logic
59
  headers = {"Authorization": f"Bearer {hf_token}"} if hf_token else {}