paulcalzada commited on
Commit
5df282b
·
verified ·
1 Parent(s): 6068077

Update app.py

Browse files

fix retriever bug 1

Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -86,6 +86,16 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
86
  value="Clear All",
87
  components=[spec, api_key, out_code]
88
  )
 
 
 
 
 
 
 
 
 
 
89
 
90
  def copy_to_clipboard_fn(text):
91
  return text
@@ -102,7 +112,7 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
102
  outputs=[run_btn, loading_state],
103
  show_progress=False
104
  ).then(
105
- fn=run_generation,
106
  inputs=[spec, use_rag, top_k, model_choice, api_key, temperature, top_p, max_new_tokens],
107
  outputs=[out_code],
108
  ).then(
 
86
  value="Clear All",
87
  components=[spec, api_key, out_code]
88
  )
89
+
90
+ # --- Wrapper function to handle output from the generation agent ---
91
+ def generate_only(
92
+ spec, use_rag, top_k, model_choice, api_key, temperature, top_p, max_new_tokens
93
+ ):
94
+ # The run_generation function returns three values, but we only want the first one.
95
+ verilog_code, _, _ = run_generation(
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
 
112
  outputs=[run_btn, loading_state],
113
  show_progress=False
114
  ).then(
115
+ fn=generate_only,
116
  inputs=[spec, use_rag, top_k, model_choice, api_key, temperature, top_p, max_new_tokens],
117
  outputs=[out_code],
118
  ).then(