Spaces:
Sleeping
Sleeping
tolist()
Browse files
app.py
CHANGED
|
@@ -261,7 +261,7 @@ def predict_malware(img_array: np.ndarray) -> str:
|
|
| 261 |
prediction = app.state.model.predict(img_array)
|
| 262 |
return {
|
| 263 |
"result": MAL_CLASSES[np.argmax(prediction)],
|
| 264 |
-
"all_results": dict(zip(MAL_CLASSES, softmax(prediction)))
|
| 265 |
}
|
| 266 |
except Exception as e:
|
| 267 |
logger.error(f"Prediction error: {str(e)}")
|
|
|
|
| 261 |
prediction = app.state.model.predict(img_array)
|
| 262 |
return {
|
| 263 |
"result": MAL_CLASSES[np.argmax(prediction)],
|
| 264 |
+
"all_results": dict(zip(MAL_CLASSES, softmax(prediction).tolist()))
|
| 265 |
}
|
| 266 |
except Exception as e:
|
| 267 |
logger.error(f"Prediction error: {str(e)}")
|