paulcalzada commited on
Commit
21ffe15
·
1 Parent(s): 9592ee8

Trying to do embedded copy button

Browse files
Files changed (1) hide show
  1. app.py +23 -8
app.py CHANGED
@@ -30,7 +30,7 @@ except Exception as e:
30
  # --- Gradio UI setup below ---
31
  with gr.Blocks(title="DeepV for RTL (Model-Agnostic)") as demo:
32
  gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)")
33
-
34
  with gr.Row():
35
  with gr.Column(scale=2):
36
  with gr.Row():
@@ -64,13 +64,15 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)") as demo:
64
  run_btn = gr.Button("Generate Verilog", variant="primary")
65
  with gr.Column(scale=3):
66
  gr.Markdown("**Output**")
67
- out_code = gr.Textbox(
68
- label="Generated Verilog",
69
- lines=28,
70
- interactive=False,
71
- placeholder="// Your Verilog code will appear here"
72
- )
73
- copy_button = gr.Button("Copy Code", variant="secondary")
 
 
74
 
75
  with gr.Tab("Retrieved Items (names + scores)"):
76
  retrieved_list = gr.Textbox(
@@ -107,6 +109,19 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)") as demo:
107
  """
108
  )
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  if __name__ == "__main__":
111
  if 'agent_module' in locals():
112
  demo.launch()
 
30
  # --- Gradio UI setup below ---
31
  with gr.Blocks(title="DeepV for RTL (Model-Agnostic)") as demo:
32
  gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)")
33
+
34
  with gr.Row():
35
  with gr.Column(scale=2):
36
  with gr.Row():
 
64
  run_btn = gr.Button("Generate Verilog", variant="primary")
65
  with gr.Column(scale=3):
66
  gr.Markdown("**Output**")
67
+ with gr.Group():
68
+ out_code = gr.Textbox(
69
+ label="Generated Verilog",
70
+ lines=28,
71
+ interactive=False,
72
+ placeholder="// Your Verilog code will appear here",
73
+ elem_id="verilog-output"
74
+ )
75
+ copy_button = gr.Button("📋", variant="secondary", elem_id="copy-button")
76
 
77
  with gr.Tab("Retrieved Items (names + scores)"):
78
  retrieved_list = gr.Textbox(
 
109
  """
110
  )
111
 
112
+ demo.css = """
113
+ #verilog-output > label > .label-wrap {
114
+ position: relative;
115
+ }
116
+
117
+ #copy-button {
118
+ position: absolute;
119
+ top: 20px;
120
+ right: 10px;
121
+ z-index: 10;
122
+ }
123
+ """
124
+
125
  if __name__ == "__main__":
126
  if 'agent_module' in locals():
127
  demo.launch()