justmotes commited on
Commit
6536223
·
1 Parent(s): 9dd1bf5

Fix: Disable queue and add yield delay to resolve ProtocolError

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -244,6 +244,7 @@ def run_benchmark(query):
244
 
245
  # 1. Yield Loader
246
  yield LOADER_HTML
 
247
 
248
  try:
249
  # 2. Perform Search (Live)
@@ -377,4 +378,5 @@ with gr.Blocks(theme=gr.themes.Base(), css=None, head=HEAD_HTML) as demo:
377
  query_input.submit(run_benchmark, inputs=[query_input], outputs=[results_area])
378
 
379
  if __name__ == "__main__":
380
- demo.queue().launch()
 
 
244
 
245
  # 1. Yield Loader
246
  yield LOADER_HTML
247
+ time.sleep(0.2) # Ensure loader renders before heavy processing
248
 
249
  try:
250
  # 2. Perform Search (Live)
 
378
  query_input.submit(run_benchmark, inputs=[query_input], outputs=[results_area])
379
 
380
  if __name__ == "__main__":
381
+ # Disable queue to prevent h11 LocalProtocolError on HF Spaces
382
+ demo.launch()