adelinamart commited on
Commit
b99bfa0
1 Parent(s): bbc083a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,13 +3,13 @@ from transformers import pipeline
3
 
4
  pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions")
5
 
6
- def predict(input_img):
7
- predictions = pipeline(input_img)
8
- return input_img, {p["label"]: p["score"] for p in predictions}
9
 
10
  gradio_app = gr.Interface(
11
  predict,
12
- inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
13
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=6)],
14
  title="Happy? Or Not?",
15
  )
 
3
 
4
  pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions")
5
 
6
+ def predict(input):
7
+ predictions = pipeline(input)
8
+ return input, {p["label"]: p["score"] for p in predictions}
9
 
10
  gradio_app = gr.Interface(
11
  predict,
12
+ inputs=gr.Image(label="Select info", sources=['upload', 'webcam'], type="pil"),
13
  outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=6)],
14
  title="Happy? Or Not?",
15
  )