Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model card specific features of Keras mixin don't work with JAX model converted to TF #1126

Open
merveenoyan opened this issue Oct 20, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@merveenoyan
Copy link
Contributor

merveenoyan commented Oct 20, 2022

Describe the bug

I need to investigate why JAX models converted to TF and then pushed using push_to_hub_keras don't have automatically generated sections in model card. The bare minimum should have model plot and training hyperparameters. Metrics aren't written if the history isn't kept. (which is normal for this case)
Also pinging @sayakpaul

Reproduction

Code is here: https://github.com/sayakpaul/maxim-tf/blob/main/convert_to_tf.py#L204

Logs

No response

System Info

Need to ask but is insignificant for this case.
@merveenoyan merveenoyan added the bug Something isn't working label Oct 20, 2022
@merveenoyan merveenoyan self-assigned this Oct 20, 2022
@sayakpaul
Copy link
Member

@merveenoyan thanks for reporting it.

I did some investigations:

  • I created a simple model using the functional API.
  • I then used push_to_hub_keras() to host it on Hub.

Here's the Colab: https://colab.research.google.com/gist/sayakpaul/1bea35f00acaa9926d2beb744058de1c/scratchpad.ipynb.

We see the model plot in the corresponding model repository but not the other stuff you mentioned. I wonder why the model plot doesn't appear for the MAXIM model. I can initialize the MAXIM model and actually plot the model.

You can replicate it with the following code:

from huggingface_hub.keras_mixin import from_pretrained_keras
import tensorflow as tf

model = from_pretrained_keras("sayakpaul/S-3_denoising_sidd")
tf.keras.utils.plot_model(model)

But it takes an incredibly long amount of time to plot it. Probably that's the reason the model plot is not there in the model repository.

@merveenoyan
Copy link
Contributor Author

@sayakpaul I will debug it and let you know 🙂 I wonder why hyperparams aren't there though, let's see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants