chkla commited on
Commit
68fc143
·
1 Parent(s): f7f2276

add predications label

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ def upload_file(files):
16
  def predict_topic(input_text):
17
  prediction = pipeline_classification_topics(input_text)
18
  # predicted_label = prediction[0]['label']
19
- return prediction[0]
20
 
21
  # Build Gradio interface
22
  with gr.Blocks() as demo:
@@ -26,7 +26,7 @@ with gr.Blocks() as demo:
26
  # Input text to be reframed
27
  text = gr.Textbox(label="Text")
28
  # predictions = gr.outputs.Textbox(label="Topic")
29
- predictions = gr.Label("Topic")
30
 
31
  # Trigger button for topic prediction
32
  greet_btn = gr.Button("Predict Topic")
 
16
  def predict_topic(input_text):
17
  prediction = pipeline_classification_topics(input_text)
18
  # predicted_label = prediction[0]['label']
19
+ return prediction[0]['label']
20
 
21
  # Build Gradio interface
22
  with gr.Blocks() as demo:
 
26
  # Input text to be reframed
27
  text = gr.Textbox(label="Text")
28
  # predictions = gr.outputs.Textbox(label="Topic")
29
+ predictions = gr.Label()
30
 
31
  # Trigger button for topic prediction
32
  greet_btn = gr.Button("Predict Topic")