VectorV17 commited on
Commit
3d370a8
·
verified ·
1 Parent(s): 4066424

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -15
app.py CHANGED
@@ -132,38 +132,57 @@ with gr.Blocks() as demo:
132
  # Tab (i): Debate Module
133
  with gr.Tab(label="🎙️ News Debate Agent", id=0):
134
  gr.Markdown("*State a topic and your stance. The agent will pull factual context, debate you, and score your logic.*")
 
 
 
 
 
 
 
 
 
 
 
 
135
  debate_text_input = gr.Textbox(
136
  label="Your Stance",
 
137
  placeholder="Type your claim here..."
138
  )
139
- gr.Examples(
140
- examples=[
141
- ["I believe AI will eventually destroy all human jobs."],
142
- ["Electric vehicles are the only way to save the environment."],
143
- ["Universal Basic Income will just make people lazy."]
144
- ],
145
- inputs=debate_text_input
146
- )
147
  run_debate_action = gr.Button("Deploy Counter-Argument & Score", variant="primary")
148
 
149
  # Tab (ii): Text Simplification Module
150
  with gr.Tab(label="📰 Snippet Generalizer", id=1):
151
  gr.Markdown("*Paste complex, jargon-heavy news columns here to output plain-English, executive summaries.*")
 
 
 
 
 
 
 
 
 
 
 
152
  simplify_text_input = gr.Textbox(
153
  label="Complex News Snippet",
154
  lines=4,
 
155
  placeholder="Paste text block or official reports here..."
156
  )
157
- gr.Examples(
158
- examples=[
159
- ["Despite aggressive macroeconomic headwinds and structural quantitative tightening by central banking systems, retail index trends demonstrated non-linear elasticity during fiscal evaluations."],
160
- ["The ecosystem validation vectors indicate substantial degradation in sub-surface lithospheric layers owing to chemical manufacturing runoffs, sparking compliance friction."]
161
- ],
162
- inputs=simplify_text_input
163
- )
164
  run_simplifier_action = gr.Button("Generalize for Easy Understanding", variant="primary")
165
 
166
  gr.HTML("<div style='margin-bottom: 20px;'></div>")
 
167
 
168
  # Param Configuration Module (Hidden Tuning to keep CPU fast and reliable)
169
  with gr.Accordion("⚙️ Runtime Parameter Tuning", open=False):
 
132
  # Tab (i): Debate Module
133
  with gr.Tab(label="🎙️ News Debate Agent", id=0):
134
  gr.Markdown("*State a topic and your stance. The agent will pull factual context, debate you, and score your logic.*")
135
+
136
+ # Robust Example System: Swapped to an immune dropdown component to bypass the hidden tab rendering bug
137
+ debate_example_picker = gr.Dropdown(
138
+ label="💡 Select a Preset Debate Topic Example",
139
+ choices=[
140
+ "I believe AI will eventually destroy all human jobs.",
141
+ "Electric vehicles are the only way to save the environment.",
142
+ "Universal Basic Income will just make people lazy."
143
+ ],
144
+ value="I believe AI will eventually destroy all human jobs."
145
+ )
146
+
147
  debate_text_input = gr.Textbox(
148
  label="Your Stance",
149
+ value="I believe AI will eventually destroy all human jobs.",
150
  placeholder="Type your claim here..."
151
  )
152
+
153
+ # Dynamically push selected dropdown choice into the text input instantly
154
+ debate_example_picker.change(fn=lambda x: x, inputs=debate_example_picker, outputs=debate_text_input)
155
+
 
 
 
 
156
  run_debate_action = gr.Button("Deploy Counter-Argument & Score", variant="primary")
157
 
158
  # Tab (ii): Text Simplification Module
159
  with gr.Tab(label="📰 Snippet Generalizer", id=1):
160
  gr.Markdown("*Paste complex, jargon-heavy news columns here to output plain-English, executive summaries.*")
161
+
162
+ # Robust Example System: Swapped to an immune dropdown component to bypass the hidden tab rendering bug
163
+ generalizer_example_picker = gr.Dropdown(
164
+ label="💡 Select a Preset Complex News Example",
165
+ choices=[
166
+ "Despite aggressive macroeconomic headwinds and structural quantitative tightening by central banking systems, retail index trends demonstrated non-linear elasticity during fiscal evaluations.",
167
+ "The ecosystem validation vectors indicate substantial degradation in sub-surface lithospheric layers owing to chemical manufacturing runoffs, sparking compliance friction."
168
+ ],
169
+ value="Despite aggressive macroeconomic headwinds and structural quantitative tightening by central banking systems, retail index trends demonstrated non-linear elasticity during fiscal evaluations."
170
+ )
171
+
172
  simplify_text_input = gr.Textbox(
173
  label="Complex News Snippet",
174
  lines=4,
175
+ value="Despite aggressive macroeconomic headwinds and structural quantitative tightening by central banking systems, retail index trends demonstrated non-linear elasticity during fiscal evaluations.",
176
  placeholder="Paste text block or official reports here..."
177
  )
178
+
179
+ # Dynamically push selected dropdown choice into the text input instantly
180
+ generalizer_example_picker.change(fn=lambda x: x, inputs=generalizer_example_picker, outputs=simplify_text_input)
181
+
 
 
 
182
  run_simplifier_action = gr.Button("Generalize for Easy Understanding", variant="primary")
183
 
184
  gr.HTML("<div style='margin-bottom: 20px;'></div>")
185
+
186
 
187
  # Param Configuration Module (Hidden Tuning to keep CPU fast and reliable)
188
  with gr.Accordion("⚙️ Runtime Parameter Tuning", open=False):