Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -279,16 +279,29 @@ with gr.Blocks() as demo:
|
|
279 |
outputs=pdf_file
|
280 |
)
|
281 |
|
282 |
-
with gr.Tab("Compare AWRs
|
283 |
upload_file = gr.File(label="Upload AWR Report", file_types=[".html", ".txt"])
|
284 |
upload_status = gr.Textbox(label="Upload Status")
|
285 |
upload_file.upload(fn=upload_awr_file, inputs=upload_file, outputs=upload_status)
|
|
|
286 |
refresh_button = gr.Button("π Refresh File List")
|
287 |
file_multiselect = gr.Dropdown(choices=[], label="Select AWR Files", multiselect=True)
|
288 |
refresh_button.click(fn=lambda: gr.update(choices=list_awr_files()), outputs=file_multiselect)
|
|
|
289 |
llm_compare = gr.Dropdown(choices=list(supported_llms.keys()), value="gpt-4.1", label="LLM Model for Comparison")
|
290 |
compare_output = gr.Textbox(label="Comparison Output", lines=20)
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
if __name__ == "__main__":
|
294 |
demo.launch(debug=True)
|
|
|
279 |
outputs=pdf_file
|
280 |
)
|
281 |
|
282 |
+
with gr.Tab("Compare AWRs"):
|
283 |
upload_file = gr.File(label="Upload AWR Report", file_types=[".html", ".txt"])
|
284 |
upload_status = gr.Textbox(label="Upload Status")
|
285 |
upload_file.upload(fn=upload_awr_file, inputs=upload_file, outputs=upload_status)
|
286 |
+
|
287 |
refresh_button = gr.Button("π Refresh File List")
|
288 |
file_multiselect = gr.Dropdown(choices=[], label="Select AWR Files", multiselect=True)
|
289 |
refresh_button.click(fn=lambda: gr.update(choices=list_awr_files()), outputs=file_multiselect)
|
290 |
+
|
291 |
llm_compare = gr.Dropdown(choices=list(supported_llms.keys()), value="gpt-4.1", label="LLM Model for Comparison")
|
292 |
compare_output = gr.Textbox(label="Comparison Output", lines=20)
|
293 |
+
|
294 |
+
compare_btn = gr.Button("Compare Selected AWRs")
|
295 |
+
compare_btn.click(fn=compare_awrs, inputs=[file_multiselect, llm_compare], outputs=compare_output)
|
296 |
+
|
297 |
+
# PDF Export for Compare tab
|
298 |
+
pdf_compare_button = gr.Button("π Generate Comparison PDF")
|
299 |
+
pdf_compare_file = gr.File(label="Download Comparison PDF", type="filepath")
|
300 |
+
pdf_compare_button.click(
|
301 |
+
fn=lambda comparison_text: generate_pdf(comparison_text, "", "", ""),
|
302 |
+
inputs=[compare_output],
|
303 |
+
outputs=pdf_compare_file
|
304 |
+
)
|
305 |
|
306 |
if __name__ == "__main__":
|
307 |
demo.launch(debug=True)
|