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

Explore uploading models to Hugging Face #804

Open
eu9ene opened this issue Aug 19, 2024 · 5 comments
Open

Explore uploading models to Hugging Face #804

eu9ene opened this issue Aug 19, 2024 · 5 comments
Labels
enhancement New feature or request help wanted We are not immediately planning to work on this, and will accept pull requests

Comments

@eu9ene
Copy link
Collaborator

eu9ene commented Aug 19, 2024

It will likely require converting them to HF format/Pytorch, similar to how it's done for the OPUS-MT and HPLT models:

https://huggingface.co/Helsinki-NLP/opus-mt-zh-en
https://huggingface.co/HPLT/translate-sw-en-v1.0-hplt_opus/tree/main

I also found this converter:
https://github.com/huggingface/transformers/blob/main/src/transformers/models/marian/convert_marian_to_pytorch.py

There might be useful code here as well:
https://github.com/hplt-project/HPLT-MT-Models/tree/main/v1.0/raw_scripts

@gregtatum
Copy link
Member

Most of the scripts I looked at don't support the Transformer-RNN structure that we use. Plus we'd have to support the int8shiftAlphaAll mode, which is only in forked Marian. I have some details in: Findings for the Marian to ONNX Investigation

@eu9ene
Copy link
Collaborator Author

eu9ene commented Aug 20, 2024

The HPLT models on HF are 300 Mb in size, so they look more like a Teacher model with transformer-base architecture. We can explore how to upload the student models without conversion and whether they will be usable later somehow. Maybe having proper Python bindings can help to integrate it with HF pipelines.

@eu9ene
Copy link
Collaborator Author

eu9ene commented Aug 20, 2024

Most of the scripts I looked at don't support the Transformer-RNN structure that we use. Plus we'd have to support the int8shiftAlphaAll mode, which is only in forked Marian. I have some details in: Findings for the Marian to ONNX Investigation

Yes, but it's ONNX. I'm sure you can implement everything that's in Marian in Pytorch. It doesn't mean we have to go this way though as it's definitely some work but it would be interesting to explore.

@marco-c
Copy link
Collaborator

marco-c commented Aug 20, 2024

We could start by uploading teacher models.

@eu9ene eu9ene added help wanted We are not immediately planning to work on this, and will accept pull requests enhancement New feature or request labels Aug 21, 2024
@gregtatum
Copy link
Member

Yes, but it's ONNX

The investigation wasn't just for ONNX, as there are links out to other converters. But yes, I agree that if we can get out to other formats it gives us much more options on how we can run these things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted We are not immediately planning to work on this, and will accept pull requests
Projects
None yet
Development

No branches or pull requests

3 participants