sbenel commited on
Commit
de93d77
1 Parent(s): 7217924

fix in app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -11,7 +11,7 @@ def translate(text):
11
  input = tokenizer(text, return_tensors="pt")
12
  labels = torch.tensor([1]).unsqueeze(0) # Batch size 1
13
  output = model(**input, labels=labels)
14
- logits = outputs.logits
15
  prediction = F.softmax(logits, dim=1)
16
  y_pred = torch.argmax(prediction).numpy()
17
  return y_pred
 
11
  input = tokenizer(text, return_tensors="pt")
12
  labels = torch.tensor([1]).unsqueeze(0) # Batch size 1
13
  output = model(**input, labels=labels)
14
+ logits = output.logits
15
  prediction = F.softmax(logits, dim=1)
16
  y_pred = torch.argmax(prediction).numpy()
17
  return y_pred