CVPR2022-DaGAN icon indicating copy to clipboard operation
CVPR2022-DaGAN copied to clipboard

add web demo/model to Huggingface

Open AK391 opened this issue 3 years ago • 17 comments

Hi, would you be interested in adding DaGAN to Hugging Face? The Hub offers free hosting, and it would make your work more accessible and visible to the rest of the ML community. Models/datasets/spaces(web demos) can be added to a user account or organization similar to github.

Example from other organizations: Keras: https://huggingface.co/keras-io Microsoft: https://huggingface.co/microsoft Facebook: https://huggingface.co/facebook

Example spaces with repos: github: https://github.com/salesforce/BLIP Spaces: https://huggingface.co/spaces/salesforce/BLIP

github: https://github.com/facebookresearch/omnivore Spaces: https://huggingface.co/spaces/akhaliq/omnivore

and here are guides for adding spaces/models/datasets to your org

How to add a Space: https://huggingface.co/blog/gradio-spaces how to add models: https://huggingface.co/docs/hub/adding-a-model uploading a dataset: https://huggingface.co/docs/datasets/upload_dataset.html

Please let us know if you would be interested and if you have any questions, we can also help with the technical implementation.

AK391 avatar Apr 22 '22 16:04 AK391

That's awesome, thanks, I will Integrate DaGAN into Huggingface Spaces in near future.

harlanhong avatar Apr 24 '22 01:04 harlanhong

Hi @AK391 ,

The Hugging Face is a great platform for us to present our project. However, I met a problem when deploying my code on it, It seems quite simple for you experienced guys: image

Could you help me with this problem?

harlanhong avatar Apr 24 '22 13:04 harlanhong

@harlanhong Hi, it looks like the requirements.txt file is missing so similar to github you can add a requirements.txt file to spaces https://github.com/harlanhong/CVPR2022-DaGAN/blob/master/requirements.txt

AK391 avatar Apr 24 '22 15:04 AK391

@harlanhong Hi, it looks like the requirements.txt file is missing so similar to github you can add a requirements.txt file to spaces https://github.com/harlanhong/CVPR2022-DaGAN/blob/master/requirements.txt

Thanks, it works. I will share the space link with you soon.

harlanhong avatar Apr 25 '22 03:04 harlanhong

How to use GPU in spaces. I can now run my code on it but it cost too much time when using the CPU. When I load my model on GPU, an error will occur: image

harlanhong avatar Apr 25 '22 08:04 harlanhong

@harlanhong Hi, from the spaces docs: https://huggingface.co/docs/hub/spaces

Each Spaces environment is limited to 16GB RAM and 8 CPU cores. Organization subscribers (Lab, Startup, and Enterprise) can access Spaces with one T4 GPU on a case-by-case basis. Please email us at website at huggingface.co or let us know on Twitter if you need one.

I can also send a request to assign a gpu for this space

AK391 avatar Apr 25 '22 09:04 AK391

@harlanhong Hi, from the spaces docs: https://huggingface.co/docs/hub/spaces

Each Spaces environment is limited to 16GB RAM and 8 CPU cores. Organization subscribers (Lab, Startup, and Enterprise) can access Spaces with one T4 GPU on a case-by-case basis. Please email us at website at huggingface.co or let us know on Twitter if you need one.

I can also send a request to assign a gpu for this space

Many thanks.

harlanhong avatar Apr 25 '22 11:04 harlanhong

Hey there! :wave: We opened an internal PR to provide a temporal GPU, we'll let you know once it's deployed.

osanseviero avatar Apr 25 '22 20:04 osanseviero

thanks @osanseviero also @harlanhong huggingface can also host models for free, so the pretrained checkpoints in one drive for example can be added to the huggingface model hub under your username or a organization name, more details here: https://huggingface.co/docs/hub/adding-a-model

AK391 avatar Apr 25 '22 20:04 AK391

This Space has GPU now! :rocket: :rocket:

osanseviero avatar Apr 26 '22 13:04 osanseviero

thanks @osanseviero, was testing out the space, still seem to be taking some time, 200 seconds so far with one of the examples and the output is not showing @harlanhong

AK391 avatar Apr 26 '22 14:04 AK391

The demo is currently running demo_dagan script every inference call, which means the model is reloaded every time and this is what might be making things slow.

osanseviero avatar Apr 26 '22 15:04 osanseviero

The demo is currently running demo_dagan script every inference call, which means the model is reloaded every time and this is what might be making things slow.

Oh, I see. Thanks for your reminder.

harlanhong avatar Apr 27 '22 02:04 harlanhong

thanks @osanseviero, was testing out the space, still seem to be taking some time, 200 seconds so far with one of the examples and the output is not showing @harlanhong

Hi @AK391, I have modified my code to load everything before launching, but when I test it I get an error, however, the log file doesn't report anything about that error.

harlanhong avatar Apr 27 '22 04:04 harlanhong

@harlanhong sorry for the late response, are you still getting this error and how long is inference taking on the gpu space?

AK391 avatar Apr 30 '22 05:04 AK391

@harlanhong currently its running over 600 seconds Screen Shot 2022-04-30 at 1 37 45 AM

AK391 avatar Apr 30 '22 05:04 AK391

@harlanhong any update on this?

AK391 avatar May 06 '22 14:05 AK391

Hi @harlanhong! Would you be interested in making the checkpoint available on the Hub as a model repo? It would make it easy for our community to find your model and you could attach some tags and documentation to it, like this model: https://huggingface.co/bert-base-uncased

There's documentation on how to do this, but I'm also happy to take it on or help out!

NimaBoscarino avatar Aug 27 '22 01:08 NimaBoscarino