Spaces:
Running
Running
Commit
·
35e86ac
1
Parent(s):
b24c622
Show all labels
Browse files
app.py
CHANGED
|
@@ -11,14 +11,14 @@ pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
|
|
| 11 |
|
| 12 |
# Define the classify_text function using the pipeline
|
| 13 |
def classify_text(text):
|
| 14 |
-
prediction = pipe(text)[0]
|
| 15 |
return prediction
|
| 16 |
|
| 17 |
# Create a Gradio interface
|
| 18 |
iface = gr.Interface(
|
| 19 |
fn=classify_text,
|
| 20 |
inputs=gradio.components.Textbox(label="Enter text"),
|
| 21 |
-
outputs=gr.outputs.Label(
|
| 22 |
)
|
| 23 |
|
| 24 |
# Launch the Gradio app
|
|
|
|
| 11 |
|
| 12 |
# Define the classify_text function using the pipeline
|
| 13 |
def classify_text(text):
|
| 14 |
+
prediction = pipe(text)[0]
|
| 15 |
return prediction
|
| 16 |
|
| 17 |
# Create a Gradio interface
|
| 18 |
iface = gr.Interface(
|
| 19 |
fn=classify_text,
|
| 20 |
inputs=gradio.components.Textbox(label="Enter text"),
|
| 21 |
+
outputs=gr.outputs.Label(num_top_classes=None), # Show all labels
|
| 22 |
)
|
| 23 |
|
| 24 |
# Launch the Gradio app
|