LiamKhoaLe commited on
Commit
c4d5753
·
1 Parent(s): 32bfdf7

Upd ZeroGPU loader

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -244,6 +244,14 @@ def initialize_model():
244
  if pipe is None:
245
  load_model()
246
 
 
 
 
 
 
 
 
 
247
  # Create the enhanced Gradio interface
248
  def create_interface():
249
  """Create an enhanced Gradio interface with proper layout"""
@@ -515,6 +523,9 @@ def create_interface():
515
  inputs=[summary_output],
516
  outputs=[download_summary_btn]
517
  )
 
 
 
518
 
519
  return demo
520
 
 
244
  if pipe is None:
245
  load_model()
246
 
247
+
248
+ @spaces.GPU
249
+ def zero_gpu_probe():
250
+ """Minimal GPU-tagged function so ZeroGPU detects a GPU job at startup.
251
+ It does nothing and is bound to a Gradio load event.
252
+ """
253
+ return "ready"
254
+
255
  # Create the enhanced Gradio interface
256
  def create_interface():
257
  """Create an enhanced Gradio interface with proper layout"""
 
523
  inputs=[summary_output],
524
  outputs=[download_summary_btn]
525
  )
526
+
527
+ # Bind a load-time call to a @spaces.GPU function so ZeroGPU detects it
528
+ demo.load(fn=zero_gpu_probe, inputs=None, outputs=None)
529
 
530
  return demo
531