naufderheide commited on
Commit
606c5bf
1 Parent(s): daca7bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -4,7 +4,6 @@ import shap
4
  import numpy as np
5
  import scipy as sp
6
  import torch
7
- import tensorflow as tf
8
  import transformers
9
  from transformers import pipeline
10
  from transformers import RobertaTokenizer, RobertaModel
@@ -52,7 +51,7 @@ def adr_predict(x):
52
  encoded_input = tokenizer(x, return_tensors='pt')
53
  output = model(**encoded_input)
54
  scores = output[0][0].detach().numpy()
55
- scores = tf.nn.softmax(scores)
56
 
57
  shap_values = explainer([str(x).lower()])
58
  # # Find the index of the class you want as the default reference (e.g., 'label_1')
 
4
  import numpy as np
5
  import scipy as sp
6
  import torch
 
7
  import transformers
8
  from transformers import pipeline
9
  from transformers import RobertaTokenizer, RobertaModel
 
51
  encoded_input = tokenizer(x, return_tensors='pt')
52
  output = model(**encoded_input)
53
  scores = output[0][0].detach().numpy()
54
+ scores = torch.nn.functional.softmax(scores)
55
 
56
  shap_values = explainer([str(x).lower()])
57
  # # Find the index of the class you want as the default reference (e.g., 'label_1')