Update app.py
Browse files
app.py
CHANGED
|
@@ -29,6 +29,9 @@ except Exception as e:
|
|
| 29 |
with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) as demo:
|
| 30 |
gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)", elem_id="main-title")
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column(scale=2):
|
| 34 |
with gr.Row():
|
|
@@ -100,15 +103,16 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
|
|
| 100 |
)
|
| 101 |
return verilog_code
|
| 102 |
|
| 103 |
-
# --- Function to toggle the visibility
|
| 104 |
-
def toggle_visibility(
|
| 105 |
-
|
|
|
|
| 106 |
|
| 107 |
# --- Event listeners for the UI ---
|
| 108 |
toggle_btn.click(
|
| 109 |
fn=toggle_visibility,
|
| 110 |
-
inputs=[
|
| 111 |
-
outputs=[settings_column]
|
| 112 |
)
|
| 113 |
|
| 114 |
def copy_to_clipboard_fn(text):
|
|
|
|
| 29 |
with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) as demo:
|
| 30 |
gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)", elem_id="main-title")
|
| 31 |
|
| 32 |
+
# This state variable will track the visibility of the settings
|
| 33 |
+
settings_visible = gr.State(False)
|
| 34 |
+
|
| 35 |
with gr.Row():
|
| 36 |
with gr.Column(scale=2):
|
| 37 |
with gr.Row():
|
|
|
|
| 103 |
)
|
| 104 |
return verilog_code
|
| 105 |
|
| 106 |
+
# --- Function to toggle the visibility using a state variable ---
|
| 107 |
+
def toggle_visibility(state):
|
| 108 |
+
new_state = not state
|
| 109 |
+
return new_state, gr.update(visible=new_state)
|
| 110 |
|
| 111 |
# --- Event listeners for the UI ---
|
| 112 |
toggle_btn.click(
|
| 113 |
fn=toggle_visibility,
|
| 114 |
+
inputs=[settings_visible],
|
| 115 |
+
outputs=[settings_visible, settings_column]
|
| 116 |
)
|
| 117 |
|
| 118 |
def copy_to_clipboard_fn(text):
|