Aleph-Alpha / magma

MAGMA - a GPT-style multimodal model that can understand any combination of images and language. NOTE: The freely available model from this repo is only a demo. For the latest multimodal and multilingual models from Aleph Alpha check out our website https://app.aleph-alpha.com
MIT License
469 stars 55 forks source link

Automatic model download doesn't work #23

Closed Heath123 closed 2 years ago

Heath123 commented 2 years ago

mp_rank_00_model_states.pt ends up containing:

<!DOCTYPE html><html><head><title>Google Drive - Virus scan warning</title><meta http-equiv="content-type" content="text/html; charset=utf-8"/><style nonce="t256RPQHLynZvvCq0ggl7w">/* Copyright 2022 Google Inc. All Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block,*:first-child+html .goog-inline-block{display:inline}.goog-link-button{position:relative;color:#15c;text-decoration:underline;cursor:pointer}.goog-link-button-disabled{color:#ccc;text-decoration:none;cursor:default}body{color:#222;font:normal 13px/1.4 arial,sans-serif;margin:0}.grecaptcha-badge{visibility:hidden}.uc-main{padding-top:50px;text-align:center}#uc-dl-icon{display:inline-block;margin-top:16px;padding-right:1em;vertical-align:top}#uc-text{display:inline-block;max-width:68ex;text-align:left}.uc-error-caption,.uc-warning-caption{color:#222;font-size:16px}#uc-download-link{text-decoration:none}.uc-name-size a{color:#15c;text-decoration:none}.uc-name-size a:visited{color:#61c;text-decoration:none}.uc-name-size a:active{color:#d14836;text-decoration:none}.uc-footer{color:#777;font-size:11px;padding-bottom:5ex;padding-top:5ex;text-align:center}.uc-footer a{color:#15c}.uc-footer a:visited{color:#61c}.uc-footer a:active{color:#d14836}.uc-footer-divider{color:#ccc;width:100%}</style><link rel="icon" href="null"/></head><body><div class="uc-main"><div id="uc-dl-icon" class="image-container"><div class="drive-sprite-aux-download-file"></div></div><div id="uc-text"><p class="uc-warning-caption">Google Drive can't scan this file for viruses.</p><p class="uc-warning-subcaption"><span class="uc-name-size"><a href="/open?id=1EiAY3IcKWmGADaLDzdG25ykQghUwza6L">mp_rank_00_model_states.pt</a> (12G)</span> is too large for Google to scan for viruses. Would you still like to download this file?</p><form id="downloadForm" action="https://drive.google.com/uc?id=1EiAY3IcKWmGADaLDzdG25ykQghUwza6L&amp;export=download&amp;confirm=t" method="post"><input type="submit" id="uc-download-link" class="goog-inline-block jfk-button jfk-button-action" value="Download anyway"/></form></div></div><div class="uc-footer"><hr class="uc-footer-divider"></div></body></html>

causing:

Traceback (most recent call last):
  File "/home/ubuntu/magma/example_inference.py", line 4, in <module>
    model = Magma.from_checkpoint(
  File "/home/ubuntu/magma/magma/magma.py", line 292, in from_checkpoint
    sd = torch.load(checkpoint_path, map_location=torch.device("cpu"))
  File "/usr/local/share/miniconda/lib/python3.9/site-packages/torch/serialization.py", line 593, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/share/miniconda/lib/python3.9/site-packages/torch/serialization.py", line 762, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

Possibly related to https://github.com/wkentaro/gdown/issues/26

stefan-it commented 2 years ago

Hey guys,

I think another good option would be to also host the model(s) on Hugging Face model hub.

They also provide huggingface_hub library that can be used as a nice client to get the model download integrated into magma.

We have been using this in Flair library and also hosting some of our models on the model hub.

countably1nfinite commented 2 years ago

Yes, i hope this will end up soon in hugginface. We are also setting up hosting on our infrastructure to allow for more bandwidth/ quota. Sorry for the hick-ups.

chris-aeviator commented 2 years ago

Google Drive link is also rejecting due to too many people downloading. Happy to setup a file server if we collect some VM & traffic money to a mug.

Diese Datei kann zurzeit nicht angezeigt oder heruntergeladen werden.

Diese Datei wurde in letzter Zeit von zu vielen Nutzern angezeigt oder heruntergeladen. Versuchen Sie später noch einmal, auf die Datei zuzugreifen. Falls die Datei besonders groß ist oder viele Nutzer darauf zugreifen können, kann es bis zu 24 Stunden dauern, bis Sie sie anzeigen oder herunterladen können. Sollten Sie nach 24 Stunden immer noch keinen Zugriff haben, wenden Sie sich an Ihren Domainadministrator.

Heath123 commented 2 years ago

Google Drive link is also rejecting due to too many people downloading. Happy to setup a file server if we collect some VM & traffic money to a mug.

Diese Datei kann zurzeit nicht angezeigt oder heruntergeladen werden.

Diese Datei wurde in letzter Zeit von zu vielen Nutzern angezeigt oder heruntergeladen. Versuchen Sie später noch einmal, auf die Datei zuzugreifen. Falls die Datei besonders groß ist oder viele Nutzer darauf zugreifen können, kann es bis zu 24 Stunden dauern, bis Sie sie anzeigen oder herunterladen können. Sollten Sie nach 24 Stunden immer noch keinen Zugriff haben, wenden Sie sich an Ihren Domainadministrator.

I'm serving it on my VPS at http://95.111.249.143:9876/mp_rank_00_model_states.pt but it won't be up forever and also this is my cheap personal VPS so don't overload it too much please

osanseviero commented 2 years ago

Hey all, I'm Omar from HF :hugs:

We would love to support having your models in the Hub. One thing that you might find useful is that model cards have metadata that allow reporting things such as the dataset, metrics, tags, etc. This can help with discoverability, which would be much better than through Google Drive links.

The model could live within an organization for Aleph Alpha for additional visibility, and we have a lightweight Python library called huggingface_hub that would allow users to download/cache the model locally. Would you be interested in this?

Adding the model is relatively simple, here are some instructions for it -> https://huggingface.co/docs/hub/adding-a-model. I actually have one copy here which we could transfer to your org and add a nice model card.