adorkin commited on
Commit
174c08f
1 Parent(s): 29e5b04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -24,13 +24,11 @@ def get_top_emojis(text, top_n=TOP_N):
24
  scores = torch.nn.functional.softmax(preds, dim=-1).detach().numpy()
25
  ranking = np.argsort(scores)
26
  print(ranking)
27
- ranking = ranking[::-1].squeeze()[:top_n]
28
  print(scores)
29
  print(ranking)
30
  print(model.config.id2label)
31
- for i in ranking:
32
- print(model.config.id2label[i])
33
- emojis = []
34
  return emojis
35
 
36
 
 
24
  scores = torch.nn.functional.softmax(preds, dim=-1).detach().numpy()
25
  ranking = np.argsort(scores)
26
  print(ranking)
27
+ ranking = ranking.squeeze()[::-1][:top_n]
28
  print(scores)
29
  print(ranking)
30
  print(model.config.id2label)
31
+ emojis = [model.config.id2label[i] for i in ranking]
 
 
32
  return emojis
33
 
34