paulcalzada commited on
Commit
57301b6
·
verified ·
1 Parent(s): d1db950

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -4
app.py CHANGED
@@ -55,7 +55,7 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
55
  use_rag = gr.Checkbox(value=True, label="Use Retrieval (RAG)")
56
  top_k = gr.Slider(1, 5, value=3, step=1, label="Top-K retrieved examples")
57
 
58
- # --- New UI with three text boxes for generation settings ---
59
  with gr.Row():
60
  temperature_tb = gr.Textbox(label="Temperature", value="0.2", scale=1)
61
  top_p_tb = gr.Textbox(label="Top-p", value="0.9", scale=1)
@@ -71,7 +71,11 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
71
  )
72
 
73
  with gr.Column(scale=3):
74
- gr.Markdown("**Output**")
 
 
 
 
75
  with gr.Group():
76
  out_code = gr.Textbox(
77
  label="Generated Verilog",
@@ -85,7 +89,7 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
85
  with gr.Row():
86
  clear_btn = gr.ClearButton(
87
  value="Clear All",
88
- components=[spec, out_code]
89
  )
90
 
91
  # --- Wrapper function to handle output from the generation agent ---
@@ -96,7 +100,7 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
96
  spec, use_rag, top_k, model_choice, api_key, temperature, top_p, max_new_tokens
97
  )
98
  return verilog_code
99
-
100
  def copy_to_clipboard_fn(text):
101
  return text
102
 
@@ -149,6 +153,37 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
149
  letter-spacing: 1px;
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  #verilog-output > label > .label-wrap {
153
  position: relative;
154
  }
 
55
  use_rag = gr.Checkbox(value=True, label="Use Retrieval (RAG)")
56
  top_k = gr.Slider(1, 5, value=3, step=1, label="Top-K retrieved examples")
57
 
58
+ # --- Generation settings as text boxes ---
59
  with gr.Row():
60
  temperature_tb = gr.Textbox(label="Temperature", value="0.2", scale=1)
61
  top_p_tb = gr.Textbox(label="Top-p", value="0.9", scale=1)
 
71
  )
72
 
73
  with gr.Column(scale=3):
74
+ # --- DeepV Logo and "Output" text ---
75
+ with gr.Row(elem_id="logo-and-output-row"):
76
+ gr.Image("DeepV_logo.png", label=None, height=50, width=50, elem_id="deepv-logo", show_label=False)
77
+ gr.Markdown("**Output**", elem_id="output-title")
78
+
79
  with gr.Group():
80
  out_code = gr.Textbox(
81
  label="Generated Verilog",
 
89
  with gr.Row():
90
  clear_btn = gr.ClearButton(
91
  value="Clear All",
92
+ components=[spec, out_code, temperature_tb, top_p_tb, max_new_tokens_tb] # Added settings textboxes to clear
93
  )
94
 
95
  # --- Wrapper function to handle output from the generation agent ---
 
100
  spec, use_rag, top_k, model_choice, api_key, temperature, top_p, max_new_tokens
101
  )
102
  return verilog_code
103
+
104
  def copy_to_clipboard_fn(text):
105
  return text
106
 
 
153
  letter-spacing: 1px;
154
  }
155
 
156
+ /* Styling for the logo and "Output" title */
157
+ #logo-and-output-row {
158
+ display: flex;
159
+ align-items: center; /* Vertically align items in the row */
160
+ justify-content: center; /* Center horizontally */
161
+ margin-bottom: 10px; /* Space between logo/title and output textbox */
162
+ }
163
+
164
+ #deepv-logo {
165
+ margin-right: 10px; /* Space between logo and text */
166
+ animation: fadeInScale 1.5s ease-out forwards; /* Apply animation */
167
+ }
168
+
169
+ #output-title {
170
+ margin: 0; /* Remove default margin from Markdown to prevent offset */
171
+ font-size: 1.2em; /* Adjust font size if needed */
172
+ font-weight: bold;
173
+ }
174
+
175
+ /* Keyframes for the logo animation */
176
+ @keyframes fadeInScale {
177
+ 0% {
178
+ opacity: 0;
179
+ transform: scale(0.8);
180
+ }
181
+ 100% {
182
+ opacity: 1;
183
+ transform: scale(1);
184
+ }
185
+ }
186
+
187
  #verilog-output > label > .label-wrap {
188
  position: relative;
189
  }