AnkitPatil commited on
Commit
6160819
·
1 Parent(s): 48d9a9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  # Load the zero-shot classification pipeline
5
- classifier = pipeline("zero-shot-classification", model="DAMO-NLP-SG/zero-shot-classify-SSTuning-XLM-R")
6
 
7
  # Function to perform classification
8
  def classify_text(text, candidate_labels):
@@ -14,9 +14,8 @@ iface = gr.Interface(
14
  fn=classify_text,
15
  inputs=[
16
  gr.Textbox(label="Enter Text"),
17
- gr.Textbox(label="Enter Candidate Labels (comma-separated)")
18
- ],
19
- outputs=gr.Label(num_top_classes=1),
20
  live=True,
21
  title="Zero-Shot Classification Web App",
22
  description="Enter a text and candidate labels (comma-separated) to classify.",
 
2
  from transformers import pipeline
3
 
4
  # Load the zero-shot classification pipeline
5
+ classifier = pipeline("zero-shot-classification")
6
 
7
  # Function to perform classification
8
  def classify_text(text, candidate_labels):
 
14
  fn=classify_text,
15
  inputs=[
16
  gr.Textbox(label="Enter Text"),
17
+ gr.Textbox(label="Enter Candidate Labels (comma-separated)"),
18
+ outputs=gr.Textbox(),
 
19
  live=True,
20
  title="Zero-Shot Classification Web App",
21
  description="Enter a text and candidate labels (comma-separated) to classify.",