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

CLIP CPU #62

Merged
merged 4 commits into from Jan 15, 2021
Merged

CLIP CPU #62

merged 4 commits into from Jan 15, 2021

Conversation

mszarski
Copy link
Contributor

@mszarski mszarski commented Jan 15, 2021

Hi,

Great project!

@shawwn converted the CLIP model weights to load on a cpu (https://github.com/shawwn/CLIP/blob/dev/clip_cpu.py).
This works fine for HyperTag as long as the torch device is correctly set everywhere.
However, urlretrieve() uses a Python user-agent to fetch the weights for which his server gives a 403 so the inline download fails. I'm not sure about weight hosting or licensing in general so I've not modified the UA.

Hopefully this is helpful.

Hi,

@shawwn converted the CLIP model weights to load on a cpu (https://github.com/shawwn/CLIP/blob/dev/clip_cpu.py).
This works fine for HyperTag as long as the torch device is correctly set everywhere.
However, urlretrieve() uses a Python user-agent to fetch the weights for which his server gives a 403 so the inline download fails.
I'm not sure about weight hosting in general so I've not modified the UA.
@SeanPedersen
Copy link
Member

Cool work! Hmm not sure how we deal with the downloading / licensing of the converted weights. But I would expect them to be under the same license as OG CLIP models.

@SeanPedersen
Copy link
Member

SeanPedersen commented Jan 15, 2021

Ok, I made following changes:

  • I went ahead and just removed the UA (CPU download works now, but we should probably rehost somewhere else)
  • I added explicit CPU toggle option
  • I fixed model loading for CUDA

@SeanPedersen SeanPedersen merged commit bb6e1a6 into Ravn-Tech:master Jan 15, 2021
@SeanPedersen
Copy link
Member

Ok looks good to me! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants