Luis Vizcaya commited on
Commit
1fa3dbb
·
1 Parent(s): 21f1941

Add demo.queue() and conditional truststore injection to fix HF deployment errors

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,7 +1,13 @@
1
- import truststore
2
- truststore.inject_into_ssl()
3
- import gradio as gr
4
  import os
 
 
 
 
 
 
 
 
 
5
  import json
6
  import logging
7
  import time
@@ -342,4 +348,5 @@ with gr.Blocks(theme=theme, title="Deep Research Agent") as demo:
342
  )
343
 
344
  if __name__ == "__main__":
 
345
  demo.launch()
 
 
 
 
1
  import os
2
+ # Only inject truststore if NOT running on Hugging Face Spaces
3
+ if not os.getenv("SPACE_ID"):
4
+ try:
5
+ import truststore
6
+ truststore.inject_into_ssl()
7
+ except ImportError:
8
+ pass
9
+
10
+ import gradio as gr
11
  import json
12
  import logging
13
  import time
 
348
  )
349
 
350
  if __name__ == "__main__":
351
+ demo.queue()
352
  demo.launch()