Update app.py
Browse files
app.py
CHANGED
|
@@ -76,8 +76,13 @@ with gr.Blocks(title="Text → Time Period (SetFit)") as demo:
|
|
| 76 |
scores = gr.JSON(label="Scores")
|
| 77 |
|
| 78 |
btn = gr.Button("Submit", variant="primary")
|
| 79 |
-
#
|
| 80 |
-
btn.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
gr.Examples(
|
| 83 |
examples=[
|
|
|
|
| 76 |
scores = gr.JSON(label="Scores")
|
| 77 |
|
| 78 |
btn = gr.Button("Submit", variant="primary")
|
| 79 |
+
# Stable API route name; HTTP endpoint will be /api/predict
|
| 80 |
+
btn.click(
|
| 81 |
+
predict,
|
| 82 |
+
inputs=text,
|
| 83 |
+
outputs=[pred, reason, scores],
|
| 84 |
+
api_name="predict"
|
| 85 |
+
)
|
| 86 |
|
| 87 |
gr.Examples(
|
| 88 |
examples=[
|