niknikita commited on
Commit
2ab0be5
1 Parent(s): fb986c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -59,7 +59,7 @@ model = DistillBERTClass()
59
  LEARNING_RATE = 1e-05
60
 
61
  optimizer = torch.optim.Adam(params = model.parameters(), lr=LEARNING_RATE)
62
- model = torch.load("pytorch_distilbert_news (1).bin", map_location=torch.device('cpu'))
63
  # model.load_state_dict(checkpoint['model'])
64
  # optimizer.load_state_dict(checkpoint['opt'])
65
  # model.to("cpu")
@@ -91,7 +91,7 @@ def get_predict(text):
91
  )
92
  logits = outputs[0]
93
  y_predict = torch.nn.functional.softmax(logits).cpu().detach().numpy()
94
- file_path = "decode_target (1).json"
95
 
96
  with open(file_path, 'r') as json_file:
97
  decode_target = json.load(json_file)
 
59
  LEARNING_RATE = 1e-05
60
 
61
  optimizer = torch.optim.Adam(params = model.parameters(), lr=LEARNING_RATE)
62
+ model = torch.load("pytorch_distilbert_news (3).bin", map_location=torch.device('cpu'))
63
  # model.load_state_dict(checkpoint['model'])
64
  # optimizer.load_state_dict(checkpoint['opt'])
65
  # model.to("cpu")
 
91
  )
92
  logits = outputs[0]
93
  y_predict = torch.nn.functional.softmax(logits).cpu().detach().numpy()
94
+ file_path = "sample.json"
95
 
96
  with open(file_path, 'r') as json_file:
97
  decode_target = json.load(json_file)