jer233 commited on
Commit
08d000a
·
verified ·
1 Parent(s): 5f76850

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +13 -12
demo.py CHANGED
@@ -70,18 +70,19 @@ css = """
70
  height: 100px; /* Set height to 100px */
71
  }
72
 
73
- /* Adjust the width for the accordion and prevent layout change */
74
- .gradio-accordion {
75
- width: 100%; /* Full width for accordions */
76
- max-height: 200px; /* Set a maximum height */
77
- overflow-y: auto; /* Allow scroll if content exceeds max height */
78
- margin-bottom: 10px; /* Space below the accordion */
 
79
  }
80
 
81
- /* Set the maximum height and prevent overflow for the accordion content */
82
- .gradio-accordion .accordion-content {
83
- max-height: 200px;
84
- overflow-y: auto; /* Add vertical scrollbar if content overflows */
85
  }
86
  """
87
 
@@ -129,13 +130,13 @@ with gr.Blocks(css=css) as app:
129
  submit_button.click(run_test_power, inputs=[model_name, input_text, input_text], outputs=output)
130
  clear_button.click(lambda: ("", ""), inputs=[], outputs=[input_text, output])
131
 
132
- with gr.Accordion("Disclaimer", open=False):
133
  gr.Markdown("""
134
  - **Disclaimer**: This tool is for demonstration purposes only. It is not a foolproof AI detector.
135
  - **Accuracy**: Results may vary based on input length and quality.
136
  """)
137
 
138
- with gr.Accordion("Citations", open=False):
139
  gr.Markdown("""
140
  ```
141
  @inproceedings{zhangs2024MMDMP,
 
70
  height: 100px; /* Set height to 100px */
71
  }
72
 
73
+ /* Accordion Styling */
74
+ .accordion {
75
+ width: 100%; /* Set the width of the accordion to match the parent */
76
+ max-height: 200px; /* Set a max-height for accordion */
77
+ overflow-y: auto; /* Allow scrolling if the content exceeds max height */
78
+ margin-bottom: 10px; /* Add space below accordion */
79
+ box-sizing: border-box; /* Ensure padding is included in width/height */
80
  }
81
 
82
+ /* Accordion content max-height */
83
+ .accordion-content {
84
+ max-height: 200px; /* Limit the height of the content */
85
+ overflow-y: auto; /* Add a scrollbar if content overflows */
86
  }
87
  """
88
 
 
130
  submit_button.click(run_test_power, inputs=[model_name, input_text, input_text], outputs=output)
131
  clear_button.click(lambda: ("", ""), inputs=[], outputs=[input_text, output])
132
 
133
+ with gr.Accordion("Disclaimer", open=False, elem_classes=["accordion"]):
134
  gr.Markdown("""
135
  - **Disclaimer**: This tool is for demonstration purposes only. It is not a foolproof AI detector.
136
  - **Accuracy**: Results may vary based on input length and quality.
137
  """)
138
 
139
+ with gr.Accordion("Citations", open=False, elem_classes=["accordion"]):
140
  gr.Markdown("""
141
  ```
142
  @inproceedings{zhangs2024MMDMP,