Skip to content

Tag: pickle

Unable to load pickle file in streamlit

I have some code to deploy model in streamlit. I just upload all file to github and share it in streamlit app. Here is some code It runs perfect in local. But in streamlit it has some bug It’s the first time that I work on streamlit. So, thank you for reading! Have a nice day! Answer I had the

Dill doesn’t seem to respect metaclass

I have recently begun working with dill. I have a metaclass, which I use to create a Singleton pattern. Always have one object at any instant. I am using dill to serialise.The problem is once the object is loaded back, it doesn’t respect the Singleton pattern (enforced by metaclass) and __init__ gets ca…

Cache only a single step in sklearn’s Pipeline

I want to use UMAP in my sklearn’s Pipeline, and I would like to cache that step to speed things up. However, since I have custom Transformer, the suggested method doesn’t work. Example code: If you run this, you will get a PicklingError, saying it cannot pickle the custom transformer. But I only …