Spaces:
Runtime error
Runtime error
new label field
Browse files
app.py
CHANGED
@@ -14,8 +14,9 @@ def upload_file(files):
|
|
14 |
return file_paths
|
15 |
|
16 |
def predict_topic(input_text):
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
# Build Gradio interface
|
21 |
with gr.Blocks() as demo:
|
@@ -24,7 +25,8 @@ with gr.Blocks() as demo:
|
|
24 |
|
25 |
# Input text to be reframed
|
26 |
text = gr.Textbox(label="Text")
|
27 |
-
predictions = gr.outputs.Textbox(label="Topic")
|
|
|
28 |
|
29 |
# Trigger button for topic prediction
|
30 |
greet_btn = gr.Button("Predict Topic")
|
@@ -43,7 +45,7 @@ with gr.Blocks() as demo:
|
|
43 |
# Upload file
|
44 |
# file_output = gr.File()
|
45 |
# upload_button = gr.UploadButton("Click to Upload a File", type="file", accept=".csv", label="File", outputs=[file_output])
|
46 |
-
|
47 |
# Link to paper and Github repo
|
48 |
gr.Markdown('''For more details: You can read our [paper]() or access our [code]().''')
|
49 |
|
|
|
14 |
return file_paths
|
15 |
|
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 |
|
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")
|
|
|
45 |
# Upload file
|
46 |
# file_output = gr.File()
|
47 |
# upload_button = gr.UploadButton("Click to Upload a File", type="file", accept=".csv", label="File", outputs=[file_output])
|
48 |
+
|
49 |
# Link to paper and Github repo
|
50 |
gr.Markdown('''For more details: You can read our [paper]() or access our [code]().''')
|
51 |
|