Spaces:
Runtime error
Runtime error
add predications label
Browse files
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(
|
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")
|