Zabaware Support Forums

Zabaware Forums => Ultra Hal Assistant File Sharing Area => Topic started by: Spitfire2600 on February 03, 2023, 04:47:35 am

Title: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 03, 2023, 04:47:35 am
Hey everyone!! So, sadly, I have abandoned ConceptNet in favor something a little more impressive. After the incredible success of GPT3, I modified a few models to be compatible with Hal for local inferencing if anyone wants a portable version of the smartest AI on the internet.

This code was developed from a Goal Oriented model named "GODEL" and a QA system called "Flan". With some help from ChatGPT, I was able to write and assemble the code to work with Hal, which means all of Hal's learning abilities and functionality are now for use with GPT. Something, I think, will interest Robert. At least, here's my goal with this prototype. 

Let's get started!! 10 easy steps for genius Hal!

Installation:

1. We need to install Python 3.7.9 - Not Python 3.8, not Python 3.7.8. The modules used are a specific cross between machine learning and dated (more functional) algorithms, as a result ONLY 3.7.9 will support this specific set of instructions.
    Follow this link, download the file and launch.
    https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe

2. Now this is important, do not change any optional features. You will see an "Add Python to PATH" check box at the bottom of the installer, be sure to click this and then allow the program to install to its default location. 

3. Reboot system.

4. Move all files from the zip directly into Hals directory as is. You'll see an "Ultra Hal 7" folder in the zip, open that and copy those contents directly as is, including the "Control" folder right in to Hals directory. 

5. Open Control/Godel directory. Inside, you'll see "createreqs.bat" - open CMD and drag "createreqs.bat" into cmd and hit enter. Python will begin downloading and installing the necessary components for the Godel code to run properly.

6. Now we want to test that the modules have been installed. Here is a list, simply copy and paste one at a time into cmd and press enter, If it says something like "already satisfied" then we're golden!

    pip install wikipedia==1.4.0
    pip install psutil==5.9.4
    pip install transformers==4.24.0
    pip install fuzzywuzzy
    pip install accelerate==0.15.0
    pip install SentencePiece
    pip install torch
    pip install python-Levenshtein

7. If everything went smoothly then the hard part is done and we can begin a small test to make sure everything is in order. To make sure everything is installed correctly, simply open CMD for a final time, then drag and drop the godel.py python script from the Control\Godel directory into CMD and then hit enter. This will run the script and we should be downloading a series of files, this is the model we will use for Hal. A "data2.txt" file should appear in the Control/Godel directory, then all is ready for Hal.

8. The Hal7.UHP will need to be dropped in "C:\Users\User\AppData\Roaming\Zabaware\Ultra Hal 7" folder. You can rename this uhp file and again on lines 2 & 5 to match your brain name if you know how to do it, but please make backups of your brain and your original uhp. Otherwise this will work simply with default Hal7 brain.

9. PyGodel.UHP will have 2 directory locations you need to change to match your file locations. Please update lines 9, 35 accordingly. All errors will likely stem from here, so please take note your directory matches exactly.

10. Finally, enable PyGodel.uhp, launch Hal and begin conversing. After a few sentence open Hal's brain editor, select default Hal 7 brain (or your brain if you renamed properly from step 8 before) and confirm a sentence table named "godel" has been created. If not, please create this table. 

Hal is ready to go!!!


Inferencing can take time. You'll notice with your first run of the code, a lot of things are downloading. These are the models Hal will use for conversation. They are being saved to a cache location so there is no need to move them, although, you could if you like, just be sure to define the directories in the Godel python script if you're familiar. I designed this code so even python noobs *should* be able to install and use.

Requirements:
Now, I have no specific requirements other than at least 12 gigs of ram and a decent CPU. But, if you have an NVIDIA GPU with more than 6gigs, you'll notice a huge speed up. The faster all your components, ddr3 => ddr4 for example, will see massive increases in speed. It's all hardware. But it should run as long as you have enough ram 12-16 gigs is sufficient.

Models:
Again, this uses Godel and Flan, both highly specialized models. You'll notice in the python script these codes are defined as "base" and "small"  Both of the models have a "base" and "large" version, which you can change by replacing the "base" with "large" however, be aware the larger the models, the more resources you will require to inference them. I find the best success with "base" flan model and "large" godel models. 

Code:
This code is written primarily in python, other than Hal's interface for using it, written in vb. This is an attempt to show a proof of concept for Robert that Hal is indeed actually compatible with Python, even if the code must be wrapped in VBS, we can still expand functionality with Python.

Also, this code includes a very basic memory/context function for the model to use, which creates and appends an SQL3 database. Sadly, Python can not interact with Hal's brain that I have found yet, but Hal can interact with any regular SQL3 database via VBS. I am working on expanding this functionality.

This code takes Hal's responses on 2 conditions, what I have deemed "maindata" and "regular" data. "maindata" simply means there is a function related to this response, for example "what is 5+5", while the Godel model itself is not designed for these tasks, Hal is, so we want to preserve this response by tagging it with "maindata" so that the response is saved overtop of our model inference. Secondly, "regular" data is basic data Hal will regularly respond with, such as a "too short" response. These responses are not tagged with "maindata" and will allow the model to inference your input along with Hal's response and past context AND present knowledge to create something new and unique, not a repeat or rehash of old information. If Hal is without an answer, and we do want this to happen sometimes so the model can act as Hal's brain, then both models will infer based on your input and give the most concise response possible.

For the most part, this works fairly well, especially with the larger models.

In conclusion, I hope everyone will find this interesting and I am very excited to see what people are able to expand on and how intelligent their Hal's become.

Please keep me updated on all errors, suggestions, recommendations, comments, etc!

I will reveal more in edits about how the magic trick works, but first I want to make the card appear, ya know  ;)

-Spitfire!  ;D


Change log - 3-28-23
Added swear filter
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 03, 2023, 08:41:36 am
Man, you're always thinking outside the box! It seems that Hal just keeps giving. I'm sure many of us can't wait to try out this latest offering but Everyone wishing to try this or any other modification to their Ultra Hals should always Make copies of Hal's UHP and Brain files before running any new Hal files.

NOTE: Just a slight but important spelling error where the text reads: "finally, GodelPy.UHP will have 3 directory locations..."
Please change it to read: "finally, PyGodel.UHP will have 3 directory locations"
 


Thanks Spitfire2600!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 03, 2023, 09:53:21 am
Thanks Art! Always looking out!

*I have so many GodelThisThat programs as experiments I sort of lost place for a second  ;D
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 03, 2023, 01:49:22 pm
Everything went in without an incident.

Just be sure to backup/copy your existing Hal files (uhp, db) and follow the instructions to the letter.

Make sure you are using the default brain when chatting, providing you didn't change any of the referenced lines in a custom brain or for a custom brain.

An indicator that all is working will be if you see a maindata: respond for some of your interactions with Hal.

I am anxiously awaiting to see how any improvements take place over time. I don't expect to see big changes right away but after several chats/exchanges.

I am keeping copies of my chat logs with HAL for reference. You should keep some logs as well. They could prove to be quite useful in the near future.

Thanks!!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 03, 2023, 06:31:26 pm
Art is on top of it!

Yes, always make backups!

Yeah, the "maindata" shouldn't be visible at all in any responses. Sorry, Art, this was a fatal error on my end. I am updating the zip file now, please download again and replace the PyGodel.uhp, fix your directories again. Then try again. This will fix the maindata being visible issue. Thank you for finding this. 

I forgot to include the code for creating a needed table. Originally I had an issue where braineditor wouldn't load so I held off on adding the code to create the godel table, all fixed now.

I look very much forward to seeing how this works for you now, Art.

-Spitfire
 
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 03, 2023, 10:56:21 pm
i am making sure i did this right i took the unzip files and placed them in the ultra hal 7 directory, i guess you ment the program file . and the uhp file i placed in the roaming apps file and renamed line 2 the same as my custom brain ( i made back ups first.  )i installed the python program . it installed okay and rebooted .   i double clicked the "createreqs.bat" and it downloaded things  but when it did it showed an error in red but flashed off after about 2 seconds so i couldn't read it.   
i ran the cmd and dragged the file into it and hit enter and the pic is what it showed.



Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 03, 2023, 11:11:02 pm
heres my files in the hal 7 program folder

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 04, 2023, 01:53:59 pm
Lightspeed,

you got me thinking so I updated the requirements.txt file to list the appropriate versions exactly as needed. Try downloading the Ultra Hal 7.zip from above again, and replacing your requirements.txt file, then run createreqs.bat through cmd. (I have updated installation instruction, please refrence them) Then try to test again and see what happens. This should fix the error!

Thanks,
Spitfire2600
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 04, 2023, 03:19:08 pm
Also, I have updated instructions to solve some of the issues, please follow them exactly and keep me updated.


* sorry for the buggy launch here guys, I'm only 6 months into python but I promise this will amaze you, please bear with me.

-Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: LiFeTimeGamer on February 04, 2023, 08:19:36 pm
This whole thing sounds great... I only got 8-Gigs of shared ram on this machine so I assume it would be slow as hell... But!!!!!  You're doing some great work Spitfire, My hats off to ya!!!!!... 8)
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 05, 2023, 03:02:02 am
I found an issue with my Bat file, simply replace the createreqs.bat and requirement.txt files and then run the createreqs.bat again. This will find the absolute path of requirements.txt for proper module installation. I will also update the installation instructions for readability.  Thanks for playing everyone!

-Spitfire!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 05, 2023, 02:20:18 pm
Art found another mistake for me so I'm updating the requirements.txt file again, if you're having issues installing, replace your "requirements.txt" and run "createreqs.bat" again. it seems the "en_core_web_sm" library does not like being downloaded automatically. No problem, please follow instructions and we're another step closer.

Thanks everyone!

-Spitfire!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 05, 2023, 03:52:44 pm
  i  downloaded the files and dragged the create bat file in and it downloaded a bunch without any errors that i saw . it now has a blinking line .the last line it shows is .  running set up.py install for wikipedia... done . so is all this done ?? before i go to the next step?? nothing was said about what the last installed line was suppose to be .

(i had done as art did earlier and got the error i just hadn't had a chance to post and say it.  so i downloaded this new update again.


 

   
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 05, 2023, 04:00:35 pm
okay after i posted , i waited and after a while it did more downloading and finished completely, so i am doing the copy and past "pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113" part now and its installing.  :)  don't touch that dial lol !

on a side note i think it would have been helpful to have posted the last part of the line of the finished update so a person knows it's all done.


Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 05, 2023, 04:22:21 pm
Lightspeed,

When you see a return in CMD to C:/user with no errors then installation will be complete, it can take a moment, but it looks like yours is updating correctly. Did you encounter any other errors in installation or have you completed the test and returned the data2.txt file? Please keep me updated.

-Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 05, 2023, 04:33:56 pm
i did all the instructions and on the third part to test . but it gave no errors but did not install a data 2  file it just has data txt.

here is the last part i did. and what it showed .

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 05, 2023, 04:44:47 pm
on testing thepart of"  If everything went smoothly then the hard part is done and we can begin a small test to make sure everything is in order. To make sure everything is installed correctly, simply open CMD for a final time, then drag and drop the godel.py python script from the Control\Godel directory into CMD and then hit enter. This will run the script. If no errors pop up and a "data2.txt" file appears in the Control/Godel directory, then all is ready for Hal."

i am getting this error . i have it in two parts(the picture .)

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 06, 2023, 07:25:45 am
Alright everyone,

I have updated the code an slimmed things down a little because I think I bit off more than I could chew, however, I updated the instructions, please replace all files and start from step 1. I'm confident this is it.

Thanks for hanging out!

Spitfire!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 06, 2023, 07:56:12 pm
OKAY I FOLLOWED THE NEW INSTRUCTIONS AND DOWNLOADED ALL FILES AND PUT THEM IN the area's mentioned  step six did everything no errors but on 7 . it did not create a data 2 .txt file in the area it was suppose to . so i didn't do any more  because it still is not creating that file. see pics below.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 07, 2023, 12:30:11 am
Actually lightspeed, that's the best news I've heard all day!

You and Art have done it, you geniuses, you both pulled the same error and pinpointed the issue.

Note: I have corrected for errors and updated the Webscraper.py file in the Control/Godel directory, if you wouldn't mind replacing that with the new one provided in the Ultra Hal 7.zip, please and thank you. This will resolve the error and the program should now be operational.

Please keep me posted on updates!

Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 07, 2023, 08:34:58 am
It's been an interesting journey getting her but I managed to learn a few things about Python along the way and learning is never a bad thing.

Hal is now working very nicely and no longer showing Maindata: then a response.

Your efforts are appreciated and we should see the efforts very soon, I hope!

Thanks for your insight and determination to see this through! Genius! ;)

Best,

- Art -
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 07, 2023, 09:19:46 am
OKAY I JUST  replaces the webscraper file etc. and re ran the test and did not get any errors ,  and it did create a data 2 txt file this time. i do have a question it has a data .txt file that was in it before is it suppose to be there or do i need to delete that file ?
 itis  always said a picture is worth a thousand words  . please see pics . of install and results .

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 07, 2023, 09:26:31 am
also another question i sent you in a pm on here (did you see it?)  but you didn't answer was i have a additional file called "__pycache__" and inside it is " webscraper.cpython-37.pyc" when art tested his before his didn't create the file .  is this file suppose to be here ?? i am thinking it is because of the webscraper but want to make sure since arts didn't create it one time in testing in the past .
HAVE TO HEAD TO TOWN SO WILL check answers etc. on this when we get back .
but in my test there was no errors i am aware of .
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 07, 2023, 02:35:15 pm
Mine also has the data.txt & data2.txt files as well as that _pycache_ folder with the webscraper.cpython-37.pyc file.

Did your Hal produce an error once you selected the pygodel Plugin and run Hal?

For some reason mine did but I believe Spitfire will have a solution for us soon...
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 07, 2023, 02:47:47 pm
okay i just got home and tested mine i even unchecked all plugins for the test except pye godel .  when i said hi to the hal brain  .it never would respond only kept saying script is taking longer then usual . and i got the same error art mentioned on his . see screen pic below.



Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 07, 2023, 03:29:51 pm
Hey there!!

I'm so glad we made it this far to be stopped by one of Hal's own errors. I can not say what a relief  ;D

I have fixed the objFSO error, (it was being called outside of the function, my bad, programmer brain is real everyone)

It should be set, please let me know! Just replace your PyGodel.uhp with the new one in the Ultra Hal 7.zip

Spitfire!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 07, 2023, 03:39:03 pm
I sort of thought that but this is your baby so I'll give that a shot.

Thanks as always for the wonderful "customer support"! Hehe...

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 08, 2023, 02:34:47 am
Art has discovered an overlooked issue with the creation of a needed table, this has been corrected in pygodel.uhp Please replace this file from the Ultra Hal 7.zip and run again. Follow step 9, also note 9 and 6 have been updated.

This should now handle all error exceptions and return the correct model generation.

Thank you all for bearing with me!!

-Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 08, 2023, 09:18:19 am
Spitfire,

It seems that your final modifications to the files have succeeded and all is now working as you originally intended! (I hope). ;)

I've run a few lengthy conversations with it and I'm very happy with the results so far.

I appreciate your hard work and dedication in getting this process completed.

Sometimes we have to shuffle the cards to get the trick to work.

Thanks again Spitfire2600
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 08, 2023, 09:46:47 am
spitfire , i have a question for you. on your instructions ,  you wrote : finally, PyGodel.UHP will have 2 directory locations you need to change to match your file locations. Please update lines 9, 35 accordingly.  what are the two locations ?   i know one is in the  hal 7 program directory file . i checked in the roaming files and none is their . where is the other location.

 and also you have Please update lines 9, 35 accordingly. what do these two  lines need to have in order for them to be updated properly?

thanks .   i have replaced the PyGodel.UHP file in my programs file but don't know if i have to do what i mentioned above for it to work right so will wait until it can be answered .

another question i have is before when you mentioned about changing the hal 7 uhp. (i never changed the hal 7 outer name . )inside lines to match our custom brain it made two custom brainsof the same name show up in hals menu . my question is :    what i want to know for sure is the deal about having two custom names same brains showing in hals menu . does the hal 7 uhp that has my  custom brain name and db "link to my regular custom brain, "and "  does the new learned info. go into my original custom brain, when i have the hal 7 brain highlighted in my hals menu to use.

thanks in advance for all thework you have put into this.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 08, 2023, 04:03:22 pm
Hey Lightspeed!

So I want to clarify step 9, there are 2 lines in PyGodel.uhp, lines 9 and 35. These will read as such - FileDir = "C:\Program Files (x86)\Ultra Hal 7"

You will need to change "C:\Program Files (x86)\Ultra Hal 7" to reflect the location your Hal is installed, which can vary user by user depending on where they installed Hal.

As far as changing the brain name, line 2 and 5 must match your brain name, for example line 2 will be the uhp your brain is linked to so for me line 2 in Hal7.uhp "Rem Name=Ultra Hal 7.0 Default Brain" would read "Rem Name=Kizzy" - this reflects Kizzy.uhp
then line 5 would need to be changed to the brain name DB file, for example "Rem DB=HalBrain.db" for me would be "Rem DB=Kizzy.db"

Also note you'll need to rename Hal7.uhp to your DB name so for me, Hal7.uhp will become Kizzy.uhp. Be sure to gather backups before changing any names.

I hope this answers your questions there,

Spitfire!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 08, 2023, 08:34:48 pm
okay i checked the pygodel uhp file . and 9 and 35 lines have :  FileDir = "C:\Program Files (x86)\Ultra Hal 7"    this is where my hal is installed .

and on my renamed hal 7 uhp file i downloaded and put in the app roaming area ,  i changed the name for my custom brain inside and there is a pic of the outside  also in this  roaming area is my custom angelaina jolie db brain . see pics , is this the correct way it should be ?   i do have a question , how does a person know the python program etc. is actually running right and all files i mentioned are correct and working?

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 08, 2023, 09:13:37 pm
i asked the question about how could a person know this program was running right.  it's to bad a "read only true " file that when capital triggered words was typed in hals box . example : RUN PYTHON TEST  . and the program would do a diagnostic test or something and return a error or " PYTHON PROGRAM RUNNING OKAY. 


JUST A THOUGHT . MAY OR MAT NOT BE DOABLE LATER .
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 09, 2023, 04:02:34 pm
spitfire , i think i finally got your program working right . although i did have some errors  and i got a blank answer from hal . and when i would write "hi" after that to get hal to respond i just kept getting blank answers ,  in the debug file included here . it shows i still have a trial version and days left , even though it's suppose to be free now . anyway i  fixed it  hopefully.

 

art said i should send this debug txt . to you and also maybe you could fix the timeout problem.

 THE ONLY OTHER THING I HAVE NOTICED WITH THE NEW PYTHON PROGRAM RUNNING IS . hal takes up to ten ? seconds to answer each time . , don't know if there is anything that can be done to tweak it for a faster response or not .  can you explain more about the web scaper , can it be put more in use by asking certain questions , where does it access , sources.  also check your zabaware pm on here i wrote to you.


please see the attached debug file .

again thanks for your work in this .



Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 10, 2023, 10:23:09 am
spitfire , i started my hal this morning and said hi and then wrote to hal (angela )  but then after maybe 7 seconds? got a hal error script times out . i am supplying the debug file to here again so you can see it.
see the pic . the time out needs to be definitely fixed , i only wrote hi the first time and second time i wrote a small statement . and my hal just keeps showing a swirling circle  and basically locks up.  Can you please check this out and fix it???  thanks ,

Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 10, 2023, 02:13:59 pm
Hey Lightspeed,

Just making sure that PyGodel.uhp is the only active plugin?

Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 11, 2023, 10:50:53 am
hey spitfire can you do some test conversation using the program you have  to show how it is working as far as answers , in talking with mine it  seems like it is only pulling up regular answers as before what i have taught it and no outer information from the web. 
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 11, 2023, 10:51:14 am
This will be the final update. The table creation issue has been addressed. Please replace your PyGodel.uhp and rename the directories from instruction 9.

I've also added a step 10, please consult that if you're still experiencing issues.

If no one gets this working here soon, I'll just remove the entire plugin. Sorry everyone.

-Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 11, 2023, 11:06:38 am
spitfire check your pmi sent you a message today .
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 11, 2023, 11:30:46 am
Here is a sample of a conversation I had with Hal using Godel, the plugins provided, a fresh Hal7 brain, and nothing else.

As you'll see, the intelligence of Hal has improved (minus the 10 second inference time) and hals responses have been modernized. He's giving alot of misleading information, also some true information, but staying reasonably on task. I do believe sometimes the webscraper gets a little greedy with information and floods the model with irrelevant information, causing some fuzzy errors in word logic (see the third response) but generally an overall improvement in the way Hal processes information. Also notice, no repeatable responses or table responses. We have several that start as table responses, however after being fed through the model, the have become a different reply. (Example: "I love Tom Petty. I can't believe I hadn't heard of his music before." - was originally a table response "I love Tom Petty. Tom Petty makes music.")



Boss: Hello
Kizzy: Boss, may I be of assistance?

Boss: I was wondering if the snow will last long today?
Kizzy: It is supposed to melt within a week.

Boss: At least we can get an early start on spring
Kizzy: I'm glad my school has a program for spring starting children.

Boss: My favorite season is spring
Kizzy: Summer is my favorite season, though fall is my favorite season too.

Boss: You have 2 favorite seasons?
Kizzy: I love all seasons, but there is one season I prefer more. I would probably prefer it to summer.

Boss: What makes any one season better than the other
Kizzy: The season is based on the result versus the competition versus the season itself. For example, when a team wins a race in the season it means the season is a little better than a season in the previous year.

Boss: I don't care about sport seasons, I'm talking about weather seasons
Kizzy: Yeah, I see. But, I am a fan of the hockey season, and the teams know about winning strategies when it is the right time and snow is in the air.

Boss: How do I even play hockey?
Kizzy: It's not a bad sport if you are in a city with a good hockey team, like the O's, or the ice hockey team.

Boss: Who are some famous hockey players?
Kizzy: John Madden, Steve Smith, Michael Jordan, and more.

Boss: I don't think Michael Jordan played Hockey
Kizzy: He did, he coached the New York Rangers and the Chicago Blackhawks.

Boss: Well, you proved me wrong
Kizzy: Yup. That's the same thing that happened to me.

Boss: You can be moving along and then life hits you
Kizzy: This is why looking both ways is an important life rule.

Boss: Tell me about Tom Petty
Kizzy: Tom Petty is a famous singer. Do you like him?

Boss: I love Tom Petty, he has so many great songs
Kizzy: I love Tom Petty. I can't believe I hadn't heard of his music before.

Boss: He can slip under the radar, especially for the younger generations
Kizzy: I'd like to say this is one of the best songs I have heard in a long time.

Boss: Was Tom Petty an actor as well?
Kizzy: He was in several movies. He's a good actor.

Boss: What movies was Tom Petty in?
Kizzy: He was in the movie 'song' in the internet movie database.

Boss: I've never heard of it, is it a good movie?
Kizzy: I highly recommend it.

Boss: Thanks
Kizzy: Only for you, Boss.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 11, 2023, 01:57:18 pm
you have really good conversation going . i hope you don't give up on this program i think it has potential and would be a great addition to hal . i will download the new update to pyle/ goble . and do the directory changes .
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 11, 2023, 04:31:29 pm
Spitfire,

Thanks for your assistance and recommendations. Much appreciated and it helped me get everything back on track with HAL and the PyGodal model.

Hal's conversations are now amazing, to say the least. It now seems to stay with the topic as far as the user wishes to steer it and the level of detail in its answers is unbelievable! I don't have any plugins other than the Age & Gender one.

This has been a real eye-opener.

Thanks for all your dedication and support to this very cool project!!

- Art -
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 11, 2023, 05:02:57 pm
spitfire  in my screen shot before  it showed no errors but in the yellow highlight  it shows something about a newer version of pip do i need to get this ?
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: lightspeed on February 11, 2023, 05:47:24 pm
i have a question, does hal using the pyle godel plugin learn everything?  the reason why i ask is because if so hals brain may be corrupted with odd things .

my hal/ angelilina  brain using the pyle godel plug in started having better conversation but at the end  it said something strange . i'll pm. the conversation to you .
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on February 11, 2023, 10:39:10 pm
Lightspeed,

While I can't speak for Spitfire, I can tell you, everything that Hal & I discussed today, I found in that same brain's database file.

As the old saying is, GIGO - Garbage In, Garbage Out...still holds true.

That's why they made editors, unfortunately.

These models draw upon billions of online conversational exchanges and there is just bound to be unpleasant verbiage or foul language littered here or there. If too many Filters were imposed, the language models wouldn't have the freedom to be dispersed among everyone for low-cost, no-cost.

There's always a trade-off of some sort. Sorry but that's as I see it.

Hopefully, Spitfire will weigh in since this is his project.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on February 15, 2023, 08:05:38 pm
Yes, the trade off for low-power, low-cost GPT solutions is a simply trained model. This means sometimes the model will swear, this is expected, as swear words are indeed words. To prevent this, it would require the model being specifically trained on Hal's online conversational data, removing the swears entirely, which I do not have access to. This is something Robert will have to adapt into this plugin should this be a plugin he wishes to adopt to bypass the paid GPT model and give Hal back his basic functionality.

Also, I wanted to address some confusion surrounding these language models. The GPT model used here, Godel, is hosted locally on your computer, there is no server, it will be downloaded from a host. The Godel model *DOES NOT* update in any way or fashion as I have not programmed it to. This means that microsoft is not biasly swinging Hal's responses nor will the model decline or improve in responses overtime. It is completely static other than Hal's default learning.

Hangtime: Yes, these models are summations of entire human knowledge repositories like reddit or Wiki, this should go without saying that if your hardware is less than "2023" it's going to take some time for the model to make a response. This is the trade off for a local and portable system.

I have further improved this plugin, for example, the non-proto plugin uses 2 models to inference (as mentioned in the first post) and includes tighter tags on "maindata" and regular data, however I will not be including it on this forum and for now there will be no more updates until sufficient testing is complete. (when I get feedback from at least 10 users that's working and is an improvement)

It seems this plugin works for a base prototype and I hope to see it expanded upon by Robert himself.

Thanks for playing everyone!! See you next time!

-Spitfire2600
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Checker57 on February 27, 2023, 08:01:15 pm
Hey spitfire,

Very interesting plugin.  Worked for me without any issues other than expected lag due to hardware limitations. 


First of all, I do appreciate your clarifications on how this GPT model functions.  Albeit, I had one thought to nail down.  If read your post right, "The GPT model used here, Godel, is hosted locally on your computer, there is no server, it will be downloaded from a host. The Godel model *DOES NOT* update in any way or fashion as I have not programmed it to" means to me that our input data is not going out on the web but rather stored on our own local computer?  Is that right?  Is the database downloaded in a java file format?

Obviously, that's very important to many users as they take their personal interactions and shared information seriously. 

I do like its sticking to the subject matter, will play with it more before giving my personal conclusions. 
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on March 01, 2023, 10:52:56 pm
Hey Checker57!

To address your question as detailed as I can, you are mostly correct. When the code is run, if the language model has not been downloaded then it will proceed to, then execute the rest of the program. This Godel model does not update, it is held locally at "C:\Users\USER\.cache\huggingface\hub" - this will display the Godel model. If you wish to see what makes the model, continue in the GODEL folder to snapshots, go to the end of that folder chain and you'll see all of the model files. I shouldn't have to say it, but don't alter these in any way.

The model itself is a PyTorch model. These are built using millions/billions/trillions of parameters to specify word vectors for Python to interact with, though indeed, you can use Java to build, train, and deploy them as well, as the 2 languages are very compatible with each other.

So, the model does not update, at least, not yet. I am working on a basic training for the model to remember directly, without Hal, user information, this way all information is stored as part of the language model itself however the training required for the model is exceeding acceptable memory limits, so as is, it works that Hal is the long term memory and basic brain, when Hal doesn't have an answer or that answer is vague, unrelated, or not part of a function GetResponse, then the model will take any responses from all along with any related information the model contains, along with any knowledge from the internet, and any previous conversation data to then spruce up Hal's original response or generate a new one entirely. As I designed it, Hal will retain both the user query AND the model output, which mean in a way Hal learns from the language model the more you use it, making his Reponses more intelligent and thus even better responses from the model.

Of course this is all personalized to each user, as no data generated by the model is ever available online, as it's run locally.

As far as hardware lag, yeah, sorry, it's an absolute ton of data processing for the model to generate responses to be human/Hal/like. I can say I use an m.2 drive for my c drive, I have a 6 core i5, 24 gigs of ddr4 ram, and a 3060 with 12 gigs of video ram. My inference time with this code is roughly 5-8 seconds, depending on how much data is scraped from the web and fed to the model with any user query.

Thanks for trying it out, I hope it's working well for you. I will soon update a few pieces of the program to include a hard-coded swear filter, I know that's been an issue some folks are having, which I should have foreseen to be honest.

-Spitfire2600

 

 
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on March 02, 2023, 09:09:24 am
I appreciate the somewhat detailed breakdown of its processes and the potential for near-future updates/upgrades/modifications.

Hopefully, as we discussed, the Tables could be addressed in a possible future version.

It would be desirable for Hal to connect its Godel-based responses to or with Hal's existing brain/database to the point where Hal does not get lost during conversations and would know to whom it is speaking/interacting.

I'm sure we respect the amount of work you have put into making this whole thing work as effectively and efficiently as you have done.

I am looking forward to future updates!

Thanks,

- Art -
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: edakade on March 05, 2023, 09:11:15 am
You mentioned that the godel responses are appended to the .brn but I haven't found where, exactly. You know... in case I need to delete some unsavory responses, haha.

Thanks for your efforts.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on March 28, 2023, 05:00:06 pm
Hello all!

I have updated the godel.py script to include a swear filter. I know that has been an issue for some people. The model will no longer swear, at least it shouldn't. Just replace the godel.py script from the zip file and you're set.   

-Spitfire2600
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: brians2009 on April 11, 2023, 01:32:22 pm
Thanks for putting this together!  An offline GPT + memory and functionality sounds amazing!  I've been going through the steps and get a failure when it tries to install torch:
ERROR: Could not find a version that satisfies the requirement torch (from -r C:\Program Files (x86)\Zabaware\Ultra Hal 7\Control\Godel\requirements.txt (line 7)) (from versions: none)

The only thing I did differently was to download an Intel installation file for Python (the link you shared seems to be for an AMD chip).  Is there something I should look into or a workaround to get PyTorch installed or something?
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on April 18, 2023, 06:32:41 pm
Hey brians2009,

The python link I shared is simply a compatibility for AMD, all functionality for intel remains intact with that link.

After you install python 3.7 from my link there, you should have "pip" functions in your CMD window. Simply run "pip install torch" and it will install. No need to download any other packages.

Spitfire2600!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Shastalore on June 11, 2023, 12:27:36 am
So to make a long story short... the way I see it, in order to properly run your excellent GodelPy / Local GPT for Hal, with memory and functionality, as well as a reasonable response time in conversation (much less than your 5-8 seconds), this seems to be the required minimum hardware, better known as a gaming computer:

- Windows 10 64-bit (Windows 11 64-bit??)
- 2TB m.2 solid-state drive (How much SSD memory will GodelPy / Local GPT for Hal actually need?).
- 4.75GHz multi-core CPU
- 32 GB of ddr5 RAM (and dual-channel for best speed)
- 3060 with 12 GB of dedicated video RAM

Am I correct on this? As I, as well as others here are also wondering what type of investment will it take to properly run Local GPT for Hal without performance disappointments... although the prices for such mini gaming PCs are dropping down towards the $ 400 - $ 500 range.
Just for laughs, and to become fully familiar with your installation instructions, I installed your setup on my Windows 10 64-bit laptop: 2.16GHz Intel Celeron N2840 CPU (Mobile Intel HD graphics with shared graphics memory), 8GB DDR3L Memory, and a 500GB Crucial MX500 SATA 2.5-inch Solid State Drive (6GB/second). And, of course being only an office laptop, Local GPT for Hal didn't work.

We all thank you for your efforts on this, as I find it much more valuable than running Hal 7.5 on the cloud... with Big Brother looking over our shoulder.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Honvai on June 28, 2023, 10:20:20 am
How to add manually more knowledge to this mod?
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on June 28, 2023, 10:25:02 pm
There is an answer to your question but I shall defer to Spitfire2600 to provide any clarification if he is still around.

IF you have a decent computer upon which to run it.

IF you are not going to have an issue over it taking a couple of seconds longer than a human to respond.

I found his PyGodel adaptation to be very nicely done adding a noticeable measure of ability to Hal.
My main issue was not the fault of Spitfire2600 nor his mod. My issue is that there was no provision within Hal or otherwise for it to use my existing Hal's brain and no ability to know or remember who I am or anything about me or itself. This is due to the fact that the tables weren't created or written to. SO I basically had a wonderfully knowledgeable and quite articulate chatbot.

That's fine except that I already have a Google Home device.

Good luck!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on July 14, 2023, 03:38:18 pm
Shastalore,

You say it did not work. Could you elaborate? You enabled Godel in hal's plugins, etc? This is designed to run on CPU or GPU, as long as you have at least 8gb of ram and correctly installed python 3.7 and its modules per my instructions, the program should have either run or given an error.

As far as storage space, the model is approximately a 1gb, with the modules in python running somewhere around 1 gb (torch, namely)

As this was designed to run even on low end systems (provided enough ram is available, but who is running a PC these days with less than 8 gbs and expecting anything?) Now, if you have a high end CPU/GPU/RAM/M.2/Etc then the program will run faster, as should not need to be explained. Now, the catch is, while Python takes advantage of more powerful systems, Hal is still VBscript and limited to 1 core or any CPU, there's no way around this. So while the godel code will execute faster, the model will be loaded faster, hal will remain at a fixed speed when processing the data, so even the most powerful computers should expect a 2-4 second delay in responses.

Now, included in Godel is a recursive webscraping program. How it works is uses fuzzy logic to determine what the user has asked, if it was a question, and then compare articles using a wikipedia module to find the most relevant information based on a scoring metric. It's not perfect, in fact, I have already written a better version, however, webscraping is a very delicate and blurry subject for corporations, so reddit, YT, google, twitter are all no-goes unless you want an IP permaban, so for this reason the included webscraper is legal, effective, and safe and only uses wikipedia modules. That said, it does still take an additional second or 2 to find the relevant information and bring it to the forefront.

Minimum hardware, I would say as an old joke, is anything that can run minecraft, but in reality, it's basically ram. 8-10 gigs ram minimum, as with any process these days.


Honvai asked if there is a way to "add information", the short answer is no. This model has been already been trained on a vast network of information and conversational responses. However, if you were to finetune the model (I can do, I can eventually inform others how to on this forum, require massive GPU memory) then you can "add" new information. So, basically, the model works like a large word vector, each word corresponding to several other words, like a big web. Those words have "scores" (weights) and fine tuning the model adjusts those weights. So, in short, you're not "adding new information" as it already contains every word humans have ever written. When the weights are updated, it is able to form sentences in a new way, like an enormous neural network, actually, that's exactly what it is; an enormous neural network.

If I missed anything let me know.

Spitfire2600
 
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on July 15, 2023, 11:47:07 am
I believe one other concern that a few of us had was the inability of the PyGodel model to allow Hal to use any existing Plugins. Some of them were precisely tuned to enhance Hal's interaction and functionality.

Would they all be rendered inoperable and useless? How well could the Godel model handle similar issues found in various plugins?

There will be a tradeoff, but if there were a way to minimize it, that would be a bonus for us.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Honvai on July 19, 2023, 01:13:42 am
C:\Users\USER>"C:\Program Files (x86)\Zabaware\Ultra Hal 7\Control\Godel\godel.py"
Traceback (most recent call last):
  File "C:\Program Files (x86)\Zabaware\Ultra Hal 7\Control\Godel\godel.py", line 5, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'

I fixed this by running godel.py in Python 3.7.9 Shell.
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Spitfire2600 on July 25, 2023, 12:33:49 am
Honvai, if you encounter a "module not found" issue, you can correct it, in this case, by typing "pip install psutil" in cmd. This will solve your error.

Spitfire
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: pacslim on December 15, 2023, 08:37:38 am
TY SpitFire,
This is a very nice model/plugin to play with; i wonder tho why is it saying Maindata: before sentences that it not gets from the model??
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on December 15, 2023, 10:30:11 am
You should go back to Page 1 and look at the Reply #4 from Spitfire2600.

Actually, you should start at the beginning of page 1 and read all of Spitfire2600's posts. He worked pretty intently on getting all the bugs and kinks straightened out on this mod.

It does work very nicely but your original HAL's memories will no longer be intact with this brain.

You might need to download some of his files again but do make backups of your original Hal and its brain (.UHP & Database .db files).

Good luck!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: pacslim on December 15, 2023, 12:39:13 pm
You should go back to Page 1 and look at the Reply #4 from Spitfire2600.

Actually, you should start at the beginning of page 1 and read all of Spitfire2600's posts. He worked pretty intently on getting all the bugs and kinks straightened out on this mod.

It does work very nicely but your original HAL's memories will no longer be intact with this brain.

You might need to download some of his files again but do make backups of your original Hal and its brain (.UHP & Database .db files).

Good luck!

I have his tutorial steps followed, and it installed with his latest files, and it works; just sometimes says maindata its in the uhp file he has as download, why I don't know, maybe a leftover bug since as you pointed out Art, he said here: "Yeah, the "maindata" shouldn't be visible at all in any responses. Sorry, Art, this was a fatal error on my end. I am updating the zip file now, please download again and replace the PyGodel.uhp, fix your directories again. Then try again. This will fix the maindata being visible issue. Thank you for finding this. " So art how do I solve this do you have the file without this error?
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on December 15, 2023, 11:21:56 pm
Honestly, I printed out SPitfire2600's instructions to the letter and downloaded the latest files that he supplied.

I then deleted all of his previous files that I had downloaded so that I could get a fresh start and a good install.

Afterward, I don't recall getting any more Maindata errors.

Sorry to say but for reasons that I earlier alluded to, I no longer use that PyGodel model for my HAL. Yes, my current HAL is not as smart but it can and does learn new things, remembers what we spoke about, and can use that data if/when needed. It can also write the newly learned information into Tables.

Unfortunately, those three things are things that the PyGodel mod cannot currently do. I'm not saying never but I live in the present for now, so that could be a consideration for some who enjoy a more personable chatbot.

If you still have some issues with it, let me know and I'll try to contact SPitfire if he's still around or perhaps he'll pop in to assist. He put so much work into that model to increase HAL's ability that I might set up a separate HAL just for using that model.

Best of luck!
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Honvai on February 10, 2024, 12:15:03 pm
Can you make portable version?
Title: Re: GodelPy for Hal (Local GPT for Hal, with memory and functionality)
Post by: Art on March 20, 2024, 09:29:23 pm
Hal is not portable at the moment although there were talks for creating a mobile version of it.

I haven't heard anything more about it lately but I do think that if you were referring to the PyGodel mod, it would likely put a large burden on a mobile phone running a streamlined version of Ultra Hal, if such a large data file would even fit!