huggingface_hub icon indicating copy to clipboard operation
huggingface_hub copied to clipboard

Guide HF transformer users to use the corresponding hub functions

Open gante opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. We have push_to_hub_keras to push Keras models. However, HF transformer architectures have a more comprehensive model hub push in save_pretrained. It would be nice to nudge users there if they try to use push_to_hub_keras with an HF transformer.

Describe the solution you'd like A loud warning nudging users to the right place :D

Describe alternatives you've considered An exception, but might be too disruptive.

Additional context As discussed here. I don't know if there is a similar problem for PyTorch -- if there is, this issue would also be applicable there.

cc @merveenoyan

gante avatar Apr 19 '22 15:04 gante

I think most transformers TF users will just be using existing tools in transformers, I don't know if anyone has tried push_to_hub_keras with :hugs: transformers

osanseviero avatar Apr 19 '22 19:04 osanseviero

The transformer models all have the push_to_hub method which pushes everything required to the hub; it's shared by models, tokenizers, configurations, feature extractors and processors. If I understand correctly, you'd like to push for users to use push_to_hub_keras instead of that, but I think it would break the API shared across all frameworks in transformers.

LysandreJik avatar Apr 19 '22 20:04 LysandreJik

@LysandreJik no, the other way around, my concern is that users might attempt use push_to_hub_keras with transformer models, when there are better methods (as you mentioned).

@osanseviero I haven't seen related issues, so maybe I'm simply overthinking :D

This conversation started because push_to_hub_keras has a config argument, but it is not an HF model config -- it is a Keras model config. The mixed terminology may cause confusion for users:

  • push_to_hub_keras pushes to hub Keras models, but it is not meant to be used with Keras HF transformers models;
  • push_to_hub_keras has a config argument, but it has nothing to do with a standard config object in HF transformers models.

gante avatar Apr 20 '22 09:04 gante

I think this might be a bit of an overthinking; push_to_hub_keras is not as widely know as transformers push_to_hub, and everywhere in transformers docs we show push_to_hub, so I don't think people would try using push_to_hub_keras for Transformers models.

EDIT: I do see how the two different use of config can cause confusions, although we also do that with the PT mixin I think.

osanseviero avatar Apr 20 '22 09:04 osanseviero

@osanseviero I agree. To my observation, people do model.save() and then when they try to load they are asked for config or tokenizer and fail in loading, no one uses push_to_hub_keras().

merveenoyan avatar Apr 20 '22 11:04 merveenoyan

I'd say it's also related to https://github.com/huggingface/huggingface_hub/issues/824

adrinjalali avatar Apr 21 '22 09:04 adrinjalali

(closing this issue as the API evolved over time and push_to_hub_keras still has very limited usage. Anyone landing on this issue, feel free to comment and we can reopen :))

Wauplin avatar Jan 19 '24 12:01 Wauplin