Ashed00 commited on
Commit
e798c1e
·
verified ·
1 Parent(s): 3679668

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -12,6 +12,8 @@ model = AutoModelForSequenceClassification.from_pretrained("nlptown/bert-base-mu
12
 
13
  # Define prediction function
14
  def predict(texts):
 
 
15
  inputs = tokenizer(
16
  texts,
17
  return_tensors="pt",
 
12
 
13
  # Define prediction function
14
  def predict(texts):
15
+ if isinstance(texts, str):
16
+ texts = [texts]
17
  inputs = tokenizer(
18
  texts,
19
  return_tensors="pt",