Hi @dgrnd4! There are some complexities here - our models are implemented by subclassing, which gives users a lot of flexibility but means that it is impossible to save a full implementation of the model, even as a SavedModel. However, you can save specific concrete functions, which is probably what you want to do if you want to create a model artifact for inference or TFLite conversion. You can see the documentation here. For this use-case, I recommend directly using TF/Keras methods like model.save to give you more low-level control over the exported signatures, and you will probably also want to set a signature that corresponds to the exact input tensors and shapes you want to use for your TFLite model.
Also, good luck if you’re attempting a TFLite conversion! We don’t officially support it, but I suspect some of our models will convert okay,
What I was thinking is to create a KERAS model so that at the end I can use the model.save(“model.h5”) function to save everything in one file.
What do you mean with “save specific concrete functions”? The documentation that you send me is about the model already “converted” in TensorFlow so the model that I have right now is impossible to use with this function because an object.
Ah, it might be my fault! What is the ultimate goal here, exactly? Are you trying to convert your model to TFLite? Or do you just want to save the model and reload it again with from_pretrained()?
yes, @Rocketknight1 you’re right. My purpose is to convert my model folder (config.json + model.h5) to only one file in the format “.h5” or “TFLite”.
So from now, if you look at the section “Load Model” of my colab file, I have the model saved in 3 different ways: from here, how can I convert it into an unique TFLite or h5 file?