Ahmedik95316 commited on
Commit
0fffa64
·
1 Parent(s): 40b04d6

Update model/train.py

Browse files

Added code to properly save pipeline after creation which was missing and thus the reason for showing "Pipeline Available : False" in the frontend

Files changed (1) hide show
  1. model/train.py +5 -0
model/train.py CHANGED
@@ -222,6 +222,11 @@ class RobustModelTrainer:
222
  ('feature_select', feature_selector),
223
  ('model', None) # Will be set during training
224
  ])
 
 
 
 
 
225
 
226
  return pipeline
227
 
 
222
  ('feature_select', feature_selector),
223
  ('model', None) # Will be set during training
224
  ])
225
+
226
+ # Save the pipeline to .pkl format
227
+ joblib.dump(pipeline, "/tmp/pipeline.pkl") # Save complete pipeline
228
+ joblib.dump(pipeline.named_steps['model'], "/tmp/model.pkl") # Individual model
229
+ joblib.dump(pipeline.named_steps['vectorize'], "/tmp/vectorizer.pkl") # Individual vectorizer
230
 
231
  return pipeline
232