nikunjcepatel commited on
Commit
c3a0d31
·
verified ·
1 Parent(s): d7f2c99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -5
app.py CHANGED
@@ -85,13 +85,26 @@ with gr.Blocks() as demo:
85
 
86
  clear_history_button = gr.Button("Clear History")
87
 
88
- # Add scrollbar to the output JSON areas with CSS
89
- output_comparisons.style(height="300px", overflow="auto")
90
- output_history.style(height="300px", overflow="auto")
91
-
92
  clear_history_button.click(clear_history, outputs=output_history)
93
 
 
94
  demo.submit(generate_comparisons_with_history, inputs=[input_text, selected_models, gr.State()], outputs=[output_comparisons, output_history])
95
 
96
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
 
 
85
 
86
  clear_history_button = gr.Button("Clear History")
87
 
88
+ # Add a button to clear the history
 
 
 
89
  clear_history_button.click(clear_history, outputs=output_history)
90
 
91
+ # Submit event to generate the comparison and history
92
  demo.submit(generate_comparisons_with_history, inputs=[input_text, selected_models, gr.State()], outputs=[output_comparisons, output_history])
93
 
94
+ # Add custom CSS for scrollable output
95
+ demo.css("""
96
+ #output-comparisons {
97
+ height: 300px;
98
+ overflow: auto;
99
+ border: 1px solid #ddd;
100
+ padding: 10px;
101
+ }
102
+ #output-history {
103
+ height: 300px;
104
+ overflow: auto;
105
+ border: 1px solid #ddd;
106
+ padding: 10px;
107
+ }
108
+ """)
109
 
110
+ demo.launch()