keras-team / keras-hub

Pretrained model hub for Keras 3
Apache License 2.0
803 stars 243 forks source link

How to add presets with custom license #1797

Closed gcuder closed 2 months ago

gcuder commented 3 months ago

Is your feature request related to a problem? Please describe.

I'd like to add presets from hugging face in my own and want others to benefit from it. However, some of them, i.e. https://huggingface.co/GerMedBERT/medbert-512 have custom licensing.

Can I still add them to Keras? If yes, how should the licensing part be handled?

divyashreepathihalli commented 2 months ago

@gcuder thanks for filing the issue. KerasNLP supports loading presets from HuggingFace as well. As long as you are able to add the license on Huggingface you can just point to the HF url and use the preset with the Keras model. example code snippet model.from_preset("hf://username/model_name") Also FYI: Any code that is released with KerasNLP should be releasable with the Apache 2.0 license.

mattdangerw commented 2 months ago

Yup echoing what @divyashreepathihalli said! We support loading from either Huggingface's model hub or Kaggle's model hub. As long as the models comply with any requirements for those platforms, they are fully usable with our library.

To add code here (e.g. a new arch), we need to code to be permissively licensed. Otherwise we'd need to move the implementation to a separate repo with a new license.

I think that covers it so closing this issue, but feel free to reopen if anything is unclear.