bharat-raghunathan commited on
Commit
47e00f6
1 Parent(s): a0060b9

Update appv0.4

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,10 +10,10 @@ def lyrics_categories(input_text):
10
  inputs = tokenizer(input_text, return_tensors="pt")
11
  outputs = model(**inputs)
12
  predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
13
- predictions = predictions.detach().numpy()[0]
14
- predictions = predictions * 100
15
- index_sorted = np.argsort(predictions)
16
- clean_outputs = {label[idx]:predictions[idx] for idx in index_sorted}
17
  return clean_outputs
18
 
19
  iface = gr.Interface(fn=lyrics_categories,
 
10
  inputs = tokenizer(input_text, return_tensors="pt")
11
  outputs = model(**inputs)
12
  predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
13
+ predictions = predictions.detach().numpy()[0]
14
+ predictions = predictions * 100
15
+ index_sorted = np.argsort(predictions)
16
+ clean_outputs = {label[idx]:predictions[idx] for idx in index_sorted}
17
  return clean_outputs
18
 
19
  iface = gr.Interface(fn=lyrics_categories,