OFA-Sys / OFASys

OFASys: A Multi-Modal Multi-Task Learning System for Building Generalist Models
Apache License 2.0
143 stars 11 forks source link

Upload pretrained checkpoints to alternative storage providers #5

Open monatis opened 1 year ago

monatis commented 1 year ago

Congrats on the awesome work in developing a solid framework that combines tasks and modalities. I'm impressed with the ease of combining a variety of types of input and output.

I'm experimenting with the code and pretrained checkpoints, but calling OFSys.from_pretrained with the multitasking checkpoint fails most of the time while it tries to download image generation checkpoints, e.g., ViT-B-16. I had to run it several times and it usually fails with a timeout error. Is it possible that you upload these models on HF Hub? I can also serve it on my Google Cloud Storage bucket if it's ok. We can also define a keyword argument in .from_pretrained factory method to set the preference for HF Hub or GCS as I guess this is only relevant outside China. If you agree, I can prepare a PR at the weekend.

jinze1994 commented 1 year ago

Thanks for your attention. Sure we hope to make it available to more users. We will upload the dependent files to s3 or HF hub asap. We would appreciate it if you could help prepare the PR! 😄

jinze1994 commented 1 year ago

Could you please try to replace the OSS link with an HTTP link? To see if this is helpful in alleviating the timeout problem? for example, replace

https://github.com/OFA-Sys/OFASys/blob/f09a3f55292487084021947bc10c9344e1f3f06e/ofasys/adaptor/image_vqgan.py#L50

to

    vqgan_model_path: str = field(
        default="http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/tasks/image_gen/vqgan/last.ckpt",
        metadata={"help": "path of vqgan model"},
    )
    vqgan_config_path: str = field(
        default="http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/tasks/image_gen/vqgan/model.yaml",
        metadata={"help": "path of vqgan config"},
    )