florentgbelidji HF staff commited on
Commit
724e312
Β·
1 Parent(s): 674ce6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- pipe = pipeline("text-classification", model="qualitydatalab/autotrain-car-review-project-966432121")
5
 
6
  def predict(text):
7
  label2emoji = {"poor": "πŸ™", "ok": "😐", "great": "😊"}
8
- preds = pipe(text)[0]
9
- return label2emoji[preds["label"]], round(preds["score"], 5)
10
 
11
  gradio_ui = gr.Interface(
12
  fn=predict,
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ #pipe = pipeline("text-classification", model="qualitydatalab/autotrain-car-review-project-966432121")
5
 
6
  def predict(text):
7
  label2emoji = {"poor": "πŸ™", "ok": "😐", "great": "😊"}
8
+ #preds = pipe(text)[0]
9
+ return label2emoji["poor"], round(1, 5)
10
 
11
  gradio_ui = gr.Interface(
12
  fn=predict,