shadowsilence commited on
Commit
bd61b09
·
verified ·
1 Parent(s): d05becc

Upload app/app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app/app.py +2 -1
app/app.py CHANGED
@@ -224,7 +224,8 @@ def get_model(model_name):
224
  try:
225
  bert = BERT()
226
  model = SBERT(bert)
227
- state_dict = torch.load(path, map_location=DEVICE)
 
228
  model.load_state_dict(state_dict, strict=False)
229
  model.to(DEVICE)
230
  model.eval()
 
224
  try:
225
  bert = BERT()
226
  model = SBERT(bert)
227
+ # Suppress FutureWarning for internal model loading
228
+ state_dict = torch.load(path, map_location=DEVICE, weights_only=False)
229
  model.load_state_dict(state_dict, strict=False)
230
  model.to(DEVICE)
231
  model.eval()