janmariakowalski commited on
Commit
da59bed
verified
1 Parent(s): 0ba3bff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -216,6 +216,12 @@ with gr.Blocks(theme=theme, css=".gradio-container {max-width: 960px !important;
216
  output_verdict = gr.Label(label="Wynik analizy", value="Czekam na tekst do analizy...")
217
  output_scores = gr.Label(label="Szczeg贸艂owe wyniki", visible=False)
218
 
 
 
 
 
 
 
219
  # Interactive elements are defined last, after all components are created
220
  # This places the examples above the button
221
  gr.Examples(
@@ -233,11 +239,7 @@ with gr.Blocks(theme=theme, css=".gradio-container {max-width: 960px !important;
233
 
234
  submit_btn = gr.Button("Analizuj tekst", variant="primary")
235
 
236
- # Define actions
237
- def analyze_and_update(text):
238
- verdict, scores = gradio_predict(text)
239
- return verdict, gr.update(value=scores, visible=True)
240
-
241
  submit_btn.click(
242
  fn=analyze_and_update,
243
  inputs=[input_text],
 
216
  output_verdict = gr.Label(label="Wynik analizy", value="Czekam na tekst do analizy...")
217
  output_scores = gr.Label(label="Szczeg贸艂owe wyniki", visible=False)
218
 
219
+ # Define actions
220
+ def analyze_and_update(text):
221
+ verdict, scores = gradio_predict(text)
222
+ return verdict, gr.update(value=scores, visible=True)
223
+
224
+
225
  # Interactive elements are defined last, after all components are created
226
  # This places the examples above the button
227
  gr.Examples(
 
239
 
240
  submit_btn = gr.Button("Analizuj tekst", variant="primary")
241
 
242
+
 
 
 
 
243
  submit_btn.click(
244
  fn=analyze_and_update,
245
  inputs=[input_text],