BtB-ExpC commited on
Commit
1c4bff0
Β·
1 Parent(s): a688ecd

Icon tooltip?

Browse files
Files changed (1) hide show
  1. app.py +25 -17
app.py CHANGED
@@ -77,15 +77,6 @@ async def run_distractors(user_query: str, model_choice: str) -> str:
77
  # Build the Gradio Interface
78
  # -------------------------------
79
  with gr.Blocks() as demo:
80
- # Insert a custom style block to style our tab labels.
81
- gr.HTML("""
82
- <style>
83
- .tab-label {
84
- cursor: pointer;
85
- border-bottom: 1px dotted #999;
86
- }
87
- </style>
88
- """)
89
  # --- Login Page ---
90
  with gr.Column(visible=True, elem_id="login_page") as login_container:
91
  gr.Markdown("## πŸ”’ Please Login")
@@ -112,7 +103,7 @@ with gr.Blocks() as demo:
112
  interactive=True,
113
  )
114
  sampling_count = gr.Dropdown(
115
- choices=["1", "2", "3", "4", "5"],
116
  value="1",
117
  label="Sampling Count",
118
  interactive=True,
@@ -124,17 +115,34 @@ with gr.Blocks() as demo:
124
  outputs=[exercise_format]
125
  )
126
  with gr.Tabs():
127
- with gr.TabItem(
128
- # The HTML span here includes a title attribute. Hovering over it will show the tooltip.
129
- label='<span class="tab-label" title="Diagnoser: To diagnose issues with existing exercise(s) in multiple steps">Diagnoser 🩺</span>'
130
- ):
 
 
 
 
 
 
 
 
131
  gr.Markdown("### Diagnoser")
132
  diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc=...")
133
  diagnoser_button = gr.Button("Submit")
134
  diagnoser_output = gr.Textbox(label="Diagnosis", interactive=False)
135
- with gr.TabItem(
136
- label='<span class="tab-label" title="Distractors brainstorm: To generate more different distractors for the given exercise(s).">Distractors brainstorm πŸ’‘</span>'
137
- ):
 
 
 
 
 
 
 
 
 
138
  gr.Markdown("### Distractors brainstorm")
139
  distractors_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Paste your exercise here...")
140
  distractors_button = gr.Button("Submit")
 
77
  # Build the Gradio Interface
78
  # -------------------------------
79
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
80
  # --- Login Page ---
81
  with gr.Column(visible=True, elem_id="login_page") as login_container:
82
  gr.Markdown("## πŸ”’ Please Login")
 
103
  interactive=True,
104
  )
105
  sampling_count = gr.Dropdown(
106
+ choices=["1", "2🚧", "3🚧", "4🚧", "5🚧"],
107
  value="1",
108
  label="Sampling Count",
109
  interactive=True,
 
115
  outputs=[exercise_format]
116
  )
117
  with gr.Tabs():
118
+ with gr.TabItem("Diagnose issues"):
119
+ # Insert an HTML info icon with a tooltip at the top of the tab content.
120
+ gr.HTML(
121
+ """
122
+ <div style="margin-bottom: 10px;">
123
+ <span style="font-size: 1.5em; cursor: help;" title="Diagnoser: This tab first standardizes the exercise description (using a fixed model) and then diagnoses potential issues using the selected model.">
124
+ 🩺
125
+ </span>
126
+ <span style="font-size: 1em; margin-left: 5px;">Diagnoser</span>
127
+ </div>
128
+ """
129
+ )
130
  gr.Markdown("### Diagnoser")
131
  diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc=...")
132
  diagnoser_button = gr.Button("Submit")
133
  diagnoser_output = gr.Textbox(label="Diagnosis", interactive=False)
134
+ with gr.TabItem("Brainstorm distractors"):
135
+ # Insert an HTML info icon with a tooltip at the top of the tab content.
136
+ gr.HTML(
137
+ """
138
+ <div style="margin-bottom: 10px;">
139
+ <span style="font-size: 1.5em; cursor: help;" title="Distractors brainstorm: This tab provides creative distractors and brainstorming ideas based on your query.">
140
+ πŸ’‘
141
+ </span>
142
+ <span style="font-size: 1em; margin-left: 5px;">Distractors brainstorm</span>
143
+ </div>
144
+ """
145
+ )
146
  gr.Markdown("### Distractors brainstorm")
147
  distractors_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Paste your exercise here...")
148
  distractors_button = gr.Button("Submit")