ysharma HF staff commited on
Commit
25d07a7
1 Parent(s): 6a171c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -7,19 +7,21 @@ with gr.Blocks(css=".column-form .wrap {flex-direction: column;}") as demo:
7
  options = gr.Radio(["Llama", "Mistral", "Gemma"], label="Model", elem_classes="column-form")
8
  options2 = gr.CheckboxGroup(["Option 1", "Option 2", "Option 3"], label="Option Set 1", elem_classes="column-form")
9
  with gr.Column() as main:
10
- open_sidebar_btn = gr.Button("Open Sidebar", scale=0)
11
- close_sidebar_btn = gr.Button("Close Sidebar", visible=False, scale=0)
12
- open_sidebar_btn.click(lambda: {
13
- open_sidebar_btn: gr.Button(visible=False),
14
- close_sidebar_btn: gr.Button(visible=True),
15
- sidebar: gr.Column(visible=True)
16
- }, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
17
- close_sidebar_btn.click(lambda: {
18
- open_sidebar_btn: gr.Button(visible=True),
19
- close_sidebar_btn: gr.Button(visible=False),
20
- sidebar: gr.Column(visible=False)
21
- }, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
 
22
  gr.Markdown("# Hello Blocks")
 
23
  gr.Markdown("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec nulla nec nulla fermentum fermentum. Nullam nec nulla nec nulla fermentum fermentum.")
24
 
25
  if __name__ == "__main__":
 
7
  options = gr.Radio(["Llama", "Mistral", "Gemma"], label="Model", elem_classes="column-form")
8
  options2 = gr.CheckboxGroup(["Option 1", "Option 2", "Option 3"], label="Option Set 1", elem_classes="column-form")
9
  with gr.Column() as main:
10
+ #open_sidebar_btn = gr.Button("Open Sidebar", scale=0)
11
+ #close_sidebar_btn = gr.Button("Close Sidebar", visible=False, scale=0)
12
+ #open_sidebar_btn.click(lambda: {
13
+ # open_sidebar_btn: gr.Button(visible=False),
14
+ # close_sidebar_btn: gr.Button(visible=True),
15
+ # sidebar: gr.Column(visible=True)
16
+ #}, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
17
+ #close_sidebar_btn.click(lambda: {
18
+ # open_sidebar_btn: gr.Button(visible=True),
19
+ # close_sidebar_btn: gr.Button(visible=False),
20
+ # sidebar: gr.Column(visible=False)
21
+ #}, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
22
+ #options.select(lambda x: gr.Markdown(value=Seleting the ))
23
  gr.Markdown("# Hello Blocks")
24
+ gr.Markdown("## You can keep the Sidebar fixed")
25
  gr.Markdown("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec nulla nec nulla fermentum fermentum. Nullam nec nulla nec nulla fermentum fermentum.")
26
 
27
  if __name__ == "__main__":