sancho10 commited on
Commit
7ea5dc7
·
verified ·
1 Parent(s): 7084f59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -64,10 +64,10 @@ def predict_class(file_path, model, label_encoder):
64
  try:
65
  # Extract and prepare features
66
  features = extract_features(file_path)
67
- feature_matrix, _ = prepare_input(features)
68
 
69
  # Make prediction
70
- prediction = model.predict(feature_matrix)
71
  predicted_index = np.argmax(prediction)
72
 
73
  # Map predicted index to class label
@@ -77,6 +77,7 @@ def predict_class(file_path, model, label_encoder):
77
  return f"Error in prediction: {str(e)}"
78
 
79
 
 
80
  # Load Pre-trained Model
81
  model = tf.keras.models.load_model("voice_classification_modelm.h5")
82
 
 
64
  try:
65
  # Extract and prepare features
66
  features = extract_features(file_path)
67
+ input_vector = prepare_input(features)
68
 
69
  # Make prediction
70
+ prediction = model.predict(input_vector)
71
  predicted_index = np.argmax(prediction)
72
 
73
  # Map predicted index to class label
 
77
  return f"Error in prediction: {str(e)}"
78
 
79
 
80
+
81
  # Load Pre-trained Model
82
  model = tf.keras.models.load_model("voice_classification_modelm.h5")
83