Spaces:
Sleeping
Sleeping
File size: 406 Bytes
bf0670d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import os
import sys
import numpy as np
import pandas as pd
import pickle
from src.exception import CustomException
def save_object(file_path, obj):
try:
dir_path = os.path.dirname(file_path)
os.makedirs(dir_path,exist_ok=True)
with open(file_path, 'wb') as file_obj:
pickle.dump(obj,file_obj)
except Exception as e:
raise CustomException(e,sys) |