Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Google is doing a crackdown on chatbots, particularily nsfw ones, running on its platform Colab. That was how most people were playing with nsfw AI chatbots for performance reasons. The future for nsfw chatbots seems to be offline, so here's a quick & simple guide for people that are new to it and want to try it.

The go to UI for text AI is KoboldAI and I talked about that before but for performance & simplicity I recommend OobaBooga.


Using this approach I got to run the Pygmalion-6B model offline on a pretty old gpu and it gives responses in 5-10s which is fantastic for such a big model. I imagine the response time is almost instant on great GPUs.

1. Install
Follow the install section https://github.com/oobabooga/text-generation-webui

2. Download AI model
Once you follow the install steps there, you can run download-model.bat , hit L None of the above, and paste mayaeary/pygmalion-6b_dev-4bit-128g  and hit enter.

This will download the Pygmalion-6B model which is very smart. Until recently you had to have a fantastic GPU to be able to run it offline. But this version https://huggingface.co/mayaeary/pygmalion-6b_dev-4bit-128g (the 4bit version) is a minimized/optimized version of the model, allowing it to run on less performant GPUs with little impact on text quality. You still need a nVidia card though, with AMD cards I think it's gonna be extremely slow.

You can find out more about Pygmalion on the subreddit https://www.reddit.com/r/PygmalionAI/

3. Add parameters
Right-click and Edit the start-webui.bat file and add to the call python line these parameters:
call python server.py  --wbits 4 --groupsize 128

This will allow OobaBoga to run 4bit models like that model. Kobold AI is prettier, but doesn't work with these kind of models yet and the responses would be considerably slower.

Myself I removed --auto-devices from that same line , it seemed to be much slower with it and caused problems sometimes but might be just for my GPU. That parameter makes it break the AI model on both CPU & GPU automatically (which is bad for performance but necessary sometimes to run huge models).

4. Run
If the install went ok, when you run start-webui.bat it loads for a few seconds and at the end it will show: Running on local URL:  http://127.0.0.1:7860

Then if you go in a browser to http://127.0.0.1:7860 you will see the OogaBooga UI.


5. Chatting
The simplest way to use it is to go to Interface mode tab and select chat as the Mode, hit Apply. Now when you go back to the Text Generation tab, it will look more like this:

There's also a Character tabs where you can customize the character, change the backstory and how it will behave. You can also save presets in \text-generation-webui\characters, similar to the Example files there.


Depending on how good your GPU is, after a while the AI will stop answering to you. It's because the conversation got so big that the GPU is running out of memory, you'll see errors in the cmd window too. At that point you have to either clear the conversation, or remove some of the replies to make space for new ones.

Files

Previews only

Comments

thomas d

I am going to try this out over the weekend.

Vitlam

Wow, it works great, it would fit great in alive if we could talk with a speach to text and she would answer with an ai voice, and if we could define the character via a textUI as in your other plugin to generate variable text.

Vitlam

I know MrCadilac tried somthing like that with replika, running a server outside of vam that grabbed the audio, converted it to text and send it to the AI

Dakoto

Wow, that work super fine, and instant reply ! I love it, you know if the gallery extension is working ? I'm gonna look what we can do with it

thomas d

Have not tried it yet, but this is all very exciting, and if we could do with this with what MrCadilac did with the voice, without too much crazy work and configuration, this would be another real step forward for VAM. I know this is like baby steps until it all comes together, but just WOW, is right! Thank you SPQR, for pushing this AI Chatbox concept forward.

Anonymous

So far I've been using novelAI combined with tavern as a replacement to pyg being down, it's working well (the only negative being that novelai is paid)

Omega Novaios

Getting this error every time I attempt to generate: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! Output generated in 0.54 seconds (0.00 tokens/s, 0 tokens, context 32, seed 1723093274)

SPQRAeternum

I think you can edit the start-webui.bat and remove "--auto-devices" from there and start it again and it should work. If it doesn't let me know. You're using the AI model from the post or a different model? Bigger models from different sources might not work depending on your GPU

Omega Novaios

I'm using the model from the post. Tried removing auto devices as well as attempting a bunch of other "--eg" settings posted on the ooba page. Using a GTX980 with 4GB, but I also have 48GB of RAM. Apparently you can run ooba on RAM alone but get the same error message no matter what setup I try.

SPQRAeternum

something that I found that might work: call python server.py --auto-devices --wbits 4 --groupsize 128 --auto-devices --gpu-memory 2200MiB --no-stream I think it's gonna try to take as much as 2gb of the GPU and leave space for other stuff and use the CPU for the rest. If it works it's probably gonna be a bit slow though You might also want to try ozcur/alpaca-native-4bit (same download process as in the post). I'll post about this one too, it's crazy quick and it should be smarter too, but it's a little less nsfw focused

Omega Novaios

Well, actually I can generate now, but I get output like this with the default parameters and settings: "the, the the in- the the the- the the the the the-- the the the the--- the the-- the the--- the the the the- the the the the the-- the the- the the-- the the the the--- the- the the- the- the- the the the the the-- the the the the the the--- the- the-"

SPQRAeternum

I found that some people on reddit had the same problem https://www.reddit.com/r/PygmalionAI/comments/129w4qh/comment/jerr465/?context=3 For some it worked updating the nvidia drivers. If not, then switching on/off some of the extensions: api & character bias, but it's kind of weird for that to fix things. But all of this AI stuff is kinda weird so.. I'm not sure but you might also need to install this: https://learn.microsoft.com/en-us/visualstudio/releases/2019/history#release-dates-and-build-numbers : Install Build Tools for Visual Studio 2019 (has to be 2019). Check "Desktop development with C++" when installing. E.g. 16.11.26 > Build Tools It's possible that I had it installed already and it just worked for me. But I've seen people mention it for 4bit models. If that fixes it pls let me know and I'll update the post for other people too

SPQRAeternum

Did you also try that other AI model I recommended in the comments? maybe that one will work. Other than that I really don't know, sorry. What I'd try would be to add more memory like --gpu-memory 3000MB maybe. Also to try running it with --no-cache and/or --xformers too. But I'm just guessing here, I really have no clue

Anonymous

Just wanted to say I followed your guide and it works wonderfully. Thanks for the introduction. Hard to believe it's offline, though it "thinks" it's connected. I even unplugged my ethernet just to double check lol. Do you recommend anywhere for character profiles? I tried a few from the discord but it breaks character pretty easily. I may also just suck at roleplaying.

Omega Novaios

I get this error when attempting to generate with ozcur_alpaca-native-4bit : KeyError: 'model.layers.16.self_attn.q_proj.wf1'

Spain

I also followed the guide and it worked flawlessly. I have a 3080, my buddy has a 4070, and when i tried to install on his pc, it failed on the initial install. Something about the Mamba wasnt installed due to incorrect cache something or another. It was the installation process that was immediately after the Select "A" screen, but didnt happen till it was almost done in that area of install.

SPQRAeternum

Yeah, it's a bit hit & miss with this AI stuff right now. For some it's a double click install and it works, others have to go through lots of obstacles and settings. From a quick search, that issue might be due to weird directories (either path is too long or it has special characters not a-z 0-9). But it could be many other things too, conflicts with existing software, permission problems, etc. can't tell without the actual error anyway