Skip to content
Advertisement

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 called. Here is the code which can reproduce

TensorFlow TextVectorization producing Ragged Tensor with no padding after loading it from pickle

I have a TensorFlow TextVectorization layer named “eng_vectorization”: and I saved it in a pickle file, using this code: Then I load that pickle file properly as new_eng_vectorization: Now I am expecting, both previous vectorization eng_vectorization and newly loaded vectorization new_eng_vectorization to work the same, but they are not. The output of original vectorization, eng_vectorization([‘Hello people’]) is a Tensor: And

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 need to cache the UMAP step. Any

Advertisement