Akis Giannoukos commited on
Commit
44521ed
·
1 Parent(s): d517324

Fixed pickling issues

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -460,7 +460,10 @@ def reset_app():
460
  # ---------------------------
461
  # UI
462
  # ---------------------------
463
- @spaces.GPU
 
 
 
464
  def create_demo():
465
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
466
  gr.Markdown(
@@ -495,11 +498,8 @@ def create_demo():
495
  finished_state = gr.State()
496
  turns_state = gr.State()
497
 
498
- # Initialize on load
499
- def _on_load():
500
- return init_state()
501
-
502
- demo.load(_on_load, inputs=None, outputs=[chatbot, scores_state, meta_state, finished_state, turns_state])
503
 
504
  # Wire interactions
505
  send_btn.click(
 
460
  # ---------------------------
461
  # UI
462
  # ---------------------------
463
+ def _on_load_init():
464
+ return init_state()
465
+
466
+
467
  def create_demo():
468
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
469
  gr.Markdown(
 
498
  finished_state = gr.State()
499
  turns_state = gr.State()
500
 
501
+ # Initialize on load (top-level function to be pickle-safe under ZeroGPU)
502
+ demo.load(_on_load_init, inputs=None, outputs=[chatbot, scores_state, meta_state, finished_state, turns_state])
 
 
 
503
 
504
  # Wire interactions
505
  send_btn.click(