Spaces:
Running
on
Zero
Running
on
Zero
edit
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def predict(text):
|
|
28 |
# scores= [x["score"] for x in outputs]
|
29 |
# Convert to percentages and create label-probability pairs
|
30 |
#probs = probabilities[0].tolist()
|
31 |
-
return {label: float(prob)
|
32 |
|
33 |
# Create Gradio interface
|
34 |
with gr.Blocks() as demo:
|
@@ -52,8 +52,6 @@ with gr.Blocks() as demo:
|
|
52 |
)
|
53 |
|
54 |
with gr.Column():
|
55 |
-
# Output label
|
56 |
-
gr.Label("Classification")
|
57 |
|
58 |
# Output probabilities
|
59 |
output_labels = gr.Label(
|
|
|
28 |
# scores= [x["score"] for x in outputs]
|
29 |
# Convert to percentages and create label-probability pairs
|
30 |
#probs = probabilities[0].tolist()
|
31 |
+
return {label: float(prob) for label, prob in zip(tokens, scores)}
|
32 |
|
33 |
# Create Gradio interface
|
34 |
with gr.Blocks() as demo:
|
|
|
52 |
)
|
53 |
|
54 |
with gr.Column():
|
|
|
|
|
55 |
|
56 |
# Output probabilities
|
57 |
output_labels = gr.Label(
|