AndreaSimeri commited on
Commit
7691ada
1 Parent(s): 42cb7ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -52,7 +52,7 @@ def LamBERTa(query):
52
  outputs = model(input_ids, labels=labels)
53
  loss, logits = outputs[:2]
54
  log_probs = torch.softmax(logits, dim=1)
55
- values, indices = torch.topk(log_probs, 5, dim=1)
56
  confidences = {id_article[i.item()] : v.item() for i, v in zip(indices[0], values[0])}
57
  for art, prob in confidences.items():
58
  texts.append(
 
52
  outputs = model(input_ids, labels=labels)
53
  loss, logits = outputs[:2]
54
  log_probs = torch.softmax(logits, dim=1)
55
+ values, indices = torch.topk(log_probs, 3, dim=1)
56
  confidences = {id_article[i.item()] : v.item() for i, v in zip(indices[0], values[0])}
57
  for art, prob in confidences.items():
58
  texts.append(