nebiyu29 commited on
Commit
41cb5c7
·
verified ·
1 Parent(s): 19a8531

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ def model_classifier(text):
17
  return f"the input text is {text}"
18
  else:
19
  encoded_input=tokenizer(text) #this is where the encoding happens
20
- logits=model(encoded).logits #this is the logits of the labels
21
  probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
22
  id2label=model.config.id2label
23
  return_probs={id2label[i]:probs.item() for i,probs in enumerate(probs_label[0])}
 
17
  return f"the input text is {text}"
18
  else:
19
  encoded_input=tokenizer(text) #this is where the encoding happens
20
+ logits=model(encoded_input).logits #this is the logits of the labels
21
  probs_label=softmax(logits,dim=-1) #turning the probability distribution into normalize form
22
  id2label=model.config.id2label
23
  return_probs={id2label[i]:probs.item() for i,probs in enumerate(probs_label[0])}