I have one model.pkl file which is a pre-trained Data Science model. I want to load that file inside handler of CDF function and do some prediction. My first question is where to keep that file in CDF. Second is how to load that file inside handler ?
Solved
Pickle File use in CDF function
Best answer by vwrocks8
I would suggest using this method to download the file to the /tmp directory from within the function. Once dowloaded you can treat it as a local file and load it.
pickled_model = pickle.load(open('/tmp/model.pkl', 'rb'))
Assuming this a python pickled model.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.