image-gpt icon indicating copy to clipboard operation
image-gpt copied to clipboard

Model runs faster with Hugging Face Transformers

Open apeguero1 opened this issue 4 years ago • 11 comments

Hi everyone,

I thought I'd share this colab which ports the Image GPT weights into a Hugging Face transformers model. Runs about 10x faster for me.

apeguero1 avatar Jun 26 '20 20:06 apeguero1

Hi @apeguero1, Thanks for the colab! It seems there is a small bug in the notebook: image

I'm thinking it should be

return img/127.5 - 1

ssss1029 avatar Jul 02 '20 21:07 ssss1029

Oh yes, thanks @ssss1029! Just fixed it 👍

apeguero1 avatar Jul 03 '20 03:07 apeguero1

Hello @apeguro1, while attempting to run this colab, I've been getting various 'name is not defined' errors. Any tips on how to deal with this? Thanks in advance. Screen Shot 2020-07-03 at 1 31 34 AM Screen Shot 2020-07-03 at 1 32 06 AM

licoriceleaf avatar Jul 03 '20 05:07 licoriceleaf

Seems like you're missing a couple of imports. run

import matplotlib.pyplot as plt
import torch

apeguero1 avatar Jul 03 '20 15:07 apeguero1

Still getting 'name 'samples' is not defined' and 'name 'clusters' is not defined'. I ran the aforementioned code in line 7. Screen Shot 2020-07-03 at 5 07 08 PM Perhaps I ran the code in the wrong location?

licoriceleaf avatar Jul 03 '20 21:07 licoriceleaf

Hmm.. could you try running all the cells by clicking 'Runtime' and then 'Run all'?

apeguero1 avatar Jul 03 '20 22:07 apeguero1

Seems to work now, thanks!

licoriceleaf avatar Jul 04 '20 07:07 licoriceleaf

Hey @apeguero1 , I'm trying to use Image GPT for a classification task, but I'm not very sure about how to do it using your Colab. How exactly should I feed the model in the training phase?

vitormm44 avatar Nov 08 '21 21:11 vitormm44

Hey @apeguero1, can you please assist with this error? Screenshot (126)

MayuO2 avatar Apr 28 '22 20:04 MayuO2

Hi @MayuO2, just pushed up a fix! BTW the huggingface repo has now added image-gpt if you wanna check that out (:

apeguero1 avatar Apr 28 '22 23:04 apeguero1

Thank you @apeguero1! It is working perfectly now:) I appreciate you sharing the huggingface repo with us

MayuO2 avatar Apr 29 '22 10:04 MayuO2