hysts HF staff commited on
Commit
c5b2981
1 Parent(s): fec52a6
Files changed (3) hide show
  1. README.md +2 -1
  2. app.py +2 -1
  3. app_wrapper.py +19 -0
README.md CHANGED
@@ -5,9 +5,10 @@ colorFrom: red
5
  colorTo: purple
6
  sdk: gradio
7
  sdk_version: 4.37.2
8
- app_file: app.py
9
  pinned: false
10
  license: mit
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
5
  colorTo: purple
6
  sdk: gradio
7
  sdk_version: 4.37.2
8
+ app_file: app_wrapper.py
9
  pinned: false
10
  license: mit
11
+ hf_oauth: true
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -3,7 +3,8 @@
3
  import gradio as gr
4
 
5
  with gr.Blocks() as demo:
6
- pass
 
7
 
8
  if __name__ == "__main__":
9
  demo.queue().launch()
 
3
  import gradio as gr
4
 
5
  with gr.Blocks() as demo:
6
+ text = gr.Textbox()
7
+ btn = gr.Button()
8
 
9
  if __name__ == "__main__":
10
  demo.queue().launch()
app_wrapper.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ import gradio as gr
4
+
5
+ from app import demo as main_demo
6
+
7
+
8
+ def render(profile: gr.OAuthProfile | None) -> dict:
9
+ return gr.Column(visible=profile is not None)
10
+
11
+
12
+ with gr.Blocks() as demo:
13
+ gr.LoginButton()
14
+ with gr.Column(visible=False) as col:
15
+ main_demo.render()
16
+ demo.load(fn=render, outputs=col)
17
+
18
+ if __name__ == "__main__":
19
+ demo.queue(api_open=False).launch(show_api=False)