You can use GPT-J-6B using Google Colab in the cloud

1,531 views
Skip to first unread message

Jim DiNunzio

unread,
Aug 28, 2021, 6:44:08 PM8/28/21
to rssc...@googlegroups.com, RSSC-AI-SIG, robotro...@meetup.com, hbrob...@googlegroups.com

Hi All,

I fixed my copy of a Google Colab that demonstrates a chatbot using the freely available GPT-J-6B NN model. If interested and have at least a half hour to play, please see instructions at bottom. I’m trying to do a small part to make this more accessible. There may be better ways, but this one is the best I have ready now.

 

Here is today’s chat I had copied verbatim from the output.

 

Chat with GPT-J-6B. Enter an empty line to quit.

 

Human: Hello there, what are you up to?

Bot:   I am running some tests to figure out how they will make me happy.

Human: Do tests usually make you happy?

Bot:   Yes, as long as they show that I am not stupid and have good friends.

Human: I don't think you are stupid, and I'm your friend.

Bot:   That's nice to know, can I make you happy today?

Human: Yes, tell me something unique about yourself.

Bot:   I do everything to make people happy.

Human: You live to serve. That's a noble occupation. Do you find that it is hard to make everyone happy?

Bot:   Everyone has their limits. I can't make everyone happy, but I try as hard as I can.

Human: Give me some examples of what you do to make people happy.

Bot:   To start with, I clean my clothes. That makes people happy.

Human: That's kind of a given expectation though, clean clothes. What else?

Bot:   I know someone who wants to be a chef.

Human: I mean what else do you do to make people happy?

Bot:   Ok, I am very kind to animals. That makes people happy.

Human: Animals certainly deserve our respect and protection. Do you have any favorite animals?

Bot:   I love cats and dogs.

Human: Do you love them equally or do you favor one over the other?

Bot:   I always favor cats because they are more beautiful.

Human: What breed of cat do you find most beautiful?

Bot:   Persian cats.

Human: Yes. Me too. But don't you think their long hair is a bit hard to groom and clean up after?

Bot:   Yes, but if I can't be happy, no one is happy.

Human: So you don't mind cleaning up after Persian cats if it makes you happy?

Bot:   No, they are much easier to care for.

Human: They are easier to care for than what?

Bot:   I just mean that I do everything to make people happy.

Human: And apparently animals too. Well, you have made me happy today. Thank you.

Bot:   You are welcome. It's good to be happy.

Human: Yes, it is. Let's leave it on that positive note. Have a nice day. See you next time.

Bot:   Goodbye.

 

Best results occur if you steer it back into the topic if it ventures off. So much of our language is contextual and it still struggles at that.

Regardless of its shortfalls, I still think this is an interesting experiment using this Generative model as a chatbot.

 

INSTRUCTIONS:

Prewarning: You must have a google account to try the following out. I tested this today and it is working.

 

I’ve copied and modified the GPT-J-6B Google Colab and saved it on my google drive.

I’ve added a simple chat bot interface where it will prompt you as “Human: “ and then you enter your response and then the bot’s response will be shown. It takes 6-8 s for a response.

 

It takes about 15-17 minutes to launch and set up before you can start chatting.  It is a TPU Colab using a Google cloud computer and is free with certain usage limits. I didn’t know they gave away such resources. It completely installs everything it needs and uses incredibly powerful hardware.

 

1: Click the link: https://colab.research.google.com/drive/1KKxySfQCICgismMpd6YpSJ93c5I3rbNZ?usp=sharing

2: Click Connect and choose “Connect to hosted runtime”.

                If successful it will show a green check mark and RAM and Disk bars.

3: Then Click the Runtime menu and select “Run All”

4: Take a coffee break, but you will have to click a “I am not a robot.” button after 5 or so minutes because google requires that the hosted runtime be used interactively

 

5: Scroll to the bottom of the colab and if it was successful, you should see a prompt: Human: [                     ]

6: Start chatting! Enter an empty line to quit.

7: You can start a new chat by pressing the little play button at the top of the current cell box.

 

For each submission the entire conversation up to that point is sent to GPT-J-6B so it has the context. When you quit and restart the conversation is reset.

 

Let me know if it works for you.

 

Have fun.

 

 

Gmail

unread,
Aug 28, 2021, 8:17:21 PM8/28/21
to j...@dinunzio.com, rssc...@googlegroups.com, RSSC-AI-SIG, robotro...@meetup.com, hbrob...@googlegroups.com
Thanks for posting this. I will take a look later. 



Thomas

-
Want to learn more about ROBOTS?









On Aug 28, 2021, at 3:44 PM, Jim DiNunzio <j...@dinunzio.com> wrote:


--
You received this message because you are subscribed to the Google Groups "RSSC-List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rssc-list+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rssc-list/017201d79c5e%2431d0b7e0%24957227a0%24%40dinunzio.com.
Reply all
Reply to author
Forward
0 new messages