mulasagg commited on
Commit
707c74b
·
1 Parent(s): b1904a9
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def load_model(model_path, device='cpu'):
32
  return model.to(device)
33
 
34
  # Get prediction
35
- def get_prediction(model, padded_sequences, img_x, device='cuda'):
36
  malware_classes = ["Benign", "RedLine Stealer", "Downloader", "RAT",
37
  "Banking Trojan", "Snake Keylogger", "Spyware"]
38
 
@@ -61,10 +61,10 @@ def predict_malware(sha256_hash):
61
 
62
  # Load the model
63
  model_path = "model_dump/model_malware_lstm (1).pkl"
64
- model = load_model(model_path, device=config.configuration["device"])
65
 
66
  # Get the prediction
67
- predicted_class = get_prediction(model, padded_sequences, img_x, config.configuration["device"])
68
 
69
  # Load the image for display
70
  img_x_display = Image.open(image_path)
 
32
  return model.to(device)
33
 
34
  # Get prediction
35
+ def get_prediction(model, padded_sequences, img_x, device='cpu'):
36
  malware_classes = ["Benign", "RedLine Stealer", "Downloader", "RAT",
37
  "Banking Trojan", "Snake Keylogger", "Spyware"]
38
 
 
61
 
62
  # Load the model
63
  model_path = "model_dump/model_malware_lstm (1).pkl"
64
+ model = load_model(model_path, device='cpu')
65
 
66
  # Get the prediction
67
+ predicted_class = get_prediction(model, padded_sequences, img_x, 'cpu')
68
 
69
  # Load the image for display
70
  img_x_display = Image.open(image_path)