akhaliq HF staff h-siyuan commited on
Commit
a47c47d
1 Parent(s): 2064a53

Create app_showui.py (#17)

Browse files

- Create app_showui.py (7d0f3ce7119c29062c1bd40af5694a436eacd0ea)


Co-authored-by: Siyuan Hu <h-siyuan@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app_showui.py +17 -0
app_showui.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import spaces
3
+
4
+ # Load the Gradio space
5
+ demo = gr.load(name="showlab/ShowUI", src="spaces")
6
+
7
+ # Ensure the main function runs on a GPU
8
+ if hasattr(demo, 'fn'):
9
+ demo.fn = spaces.GPU()(demo.fn)
10
+
11
+ # Disable API access for all functions
12
+ if hasattr(demo, 'fns'):
13
+ for fn in demo.fns.values():
14
+ fn.api_name = False
15
+
16
+ if __name__ == "__main__":
17
+ demo.launch()