Python, Blender and ChatGPT integration

115 Views Asked by At

I previously posted this but the scope was too broad. I'm trying to create an ai-powered 3D animated character. It should interact with the user as though we were on a video call with them. The character is animated by Blender using the Rhubarb plugin to handle lip sync. Everything seems to compile, but when I try to run it, I get a stack overflow error when I try to initiate the GPT model.

Error: Process finished with exit code -1073741819 (0xC0000005)

from transformers import pipeline

def chatbot_engine():
    # Initialize GPT model
    generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')

    # Generate continuation of text using GPT
    try:
        generated_text = generator("Hello, world!", max_length=100)[0]['generated_text']
    except Exception as e:
        print(f"An error occurred while generating text: {e}")
        return

    print(f"Generated text: {generated_text}")

if __name__ == "__main__":
    chatbot_engine()

System stats: Dell Inspiron 15 3280 laptop, 8GB of RAM, no GPU. Python version: VENV is using python 3.10, but I get similar errors in python 3.11.(I installed multiple python versions for backwards compatibility.IIRC, Blender uses 3.10 in it's most recent iteration.

I've tried recreating the virtual environment, updating all of the packages, and different environments (using system default 3.11 instead of the VENV's 3.10)

1

There are 1 best solutions below

0
On BEST ANSWER

According to the HuggingFace repository for the GPT model you are using, being the EleutherAI GPT Neo 2.7B model, the size of the model is over 10GB. Your computer does not have enough RAM to load the model into memory, and it is throwing a stack overflow exception because of this.

You will need to run your model on an environment with sufficient memory such as Google Colab.