User avatar
DelosBoard2052
Posts: 33
Joined: Wed Jan 30, 2019 11:54 pm
Location: Western Massachusetts, USA

Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Sat Jan 09, 2021 7:13 pm

I have created a clean(ish) image with a running implementation of GPT-2 and Tensorflow 1.13.1 that runs on the Pi 4B 8 gig (might also run on the 4G, but possibly slower.) GitHub limits file uploads to 25MB. The image is 64 GB...... does anybody have a suggestion of how best to make this available? Maybe I should sell them for $ on Etsy??? :)

By clean-ish, I mean that I have cleaned up *files I have created* that pertain to other functions the robots have, but there are a LOT of things still *installed* that do not pertain specifically to GPT-2 or Tensorflow 1.13.1 (things like speech recognition, synthesis, zmq & imagezmq, face and object detection & recognition, etc., etc.......) This image is highly customized, and folks seeking to experiment with GPT-2 on the Pi should be able to do quite a bit with this as a starting point. Apparently others have had a very hard time (as did I) getting GPT-2 to run on the Pi. All this needs you to do is burn the image, boot the Pi, open a terminal window, cd ~/Desktop/HOSTCORE/gpt-2 and then python src/speakGPT2.py

You'll get a boatload of tensorflow deprication warnings and memory allocation warnings, but it will eventually offer you the "Model prompt >>>" and you can enter your prompt and you're off to the races.

Here's a sample I just ran to test that I didn't break anything when I cleaned up the ~100 files.... Everything after "SAMPLE 1" is generated by GPT-2 lol... Anyway - please let me know if there is interest.

Dave


Model prompt >>> I've worked hard to create this disk image for folks who want to experiment so they can get a working copy of GPT-2. Now I hope to see some inspiring results, and I hope you'll all share

============SAMPLE 1 =============

with your own experience and how it goes for you! Enjoy!
I was fortunate enough to meet a guy at an airport this week who gave me a great introduction to his GPT-2 system. I had never been able to get a working copy of a GPT-2, but his system was working, and he had me work with it. I did a lot of research and spent hours trying to figure out how to get it to work. It was really nice to see someone with experience and knowledge of the system, and how to get it to work. When I went to see him I knew what to expect.

=============

Model prompt >>>

User avatar
topguy
Posts: 7082
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Sun Jan 10, 2021 10:26 am

The image is 64 GB....
You mean the SD card is 64GB ? How much space is actually used on the filesystem ? ( hint: "df -h" )

User avatar
DelosBoard2052
Posts: 33
Joined: Wed Jan 30, 2019 11:54 pm
Location: Western Massachusetts, USA

Re: Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Tue Jan 12, 2021 1:03 am

Yeah, I could shrink it... The original image used 42GB, and I deleted a boatload of HUGE models unrelated to the GPT-2 part, so it's down to 22 GB. Bigger issue though is that even at 22GB... I live out in the woods basically and I have the lightening-like speed of ***DSL*** to upload the file lol, so it would be 4+ days of continuous upload - if it never disconnected on me...

So - when I get my laptop and a copy of the image to a place that has some actually fast internet, I'll just upload it to my web hosting servers & post the address for whoever wants a copy.

User avatar
topguy
Posts: 7082
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Tue Jan 12, 2021 10:59 am

There is also a great tool called "zerofree" which can be used to fill the unused parts of a (ext2/3/4) filesystem with 0x00 so that an image compresses much better.

Even if you deleted 20GB of data, the blocks on the flash still contain those bytes and they will be part of the extracted image and will not compress well.
And you should of course try to compress your image with gzip or bzip2.

mc9625
Posts: 11
Joined: Fri Oct 27, 2017 2:36 pm

Re: Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Thu Apr 22, 2021 7:29 pm

Hi all, actually I am really interested into that image. Did you find a solution to host the image?

Pearl.852
Posts: 80
Joined: Wed Jun 08, 2016 1:22 pm
Location: Hong Kong (GMT+8)

Re: Any interest in a working disk image to run GPT-2 on a Raspberry Pi 4 - 8Gig?

Tue Apr 27, 2021 5:50 pm

@DelosBoard2052
Try use the PiShrink from https://github.com/Drewsif/PiShrink, which is a bash script that automatically shrink a pi image that will then resize to the max size of the SD card on boot.

Return to “Advanced users”