tellurion Claude Sonnet 4.6 commited on
Commit
f206837
·
1 Parent(s): 1a9eb8d

Add @spaces.GPU decorator to inference function for ZeroGPU

Browse files

ZeroGPU requires at least one @spaces.GPU-decorated function at startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. backend/appfunc.py +2 -0
backend/appfunc.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import random
3
  import traceback
4
  import gradio as gr
 
5
  import os.path as osp
6
 
7
  from huggingface_hub import hf_hub_download, list_repo_files
@@ -171,6 +172,7 @@ def set_cas_scales(accurate, cas_args):
171
  return scale_strength
172
 
173
 
 
174
  @torch.no_grad()
175
  def inference(
176
  style_enhance, bg_enhance, fg_enhance, fg_disentangle_scale,
 
2
  import random
3
  import traceback
4
  import gradio as gr
5
+ import spaces
6
  import os.path as osp
7
 
8
  from huggingface_hub import hf_hub_download, list_repo_files
 
172
  return scale_strength
173
 
174
 
175
+ @spaces.GPU(duration=120)
176
  @torch.no_grad()
177
  def inference(
178
  style_enhance, bg_enhance, fg_enhance, fg_disentangle_scale,