Spaces:
Runtime error
Runtime error
updated prediction fn to return just one value
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
|
20 |
|
21 |
# Build Gradio interface
|
22 |
with gr.Blocks() as demo:
|
@@ -25,7 +25,7 @@ with gr.Blocks() as demo:
|
|
25 |
|
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
|
|
|
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:
|
|
|
25 |
|
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
|