Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crash caused by ChatGPT-3.5 Turbo and ChatGPT-4 #2002

Closed
mishinev opened this issue Feb 22, 2024 · 14 comments · Fixed by #2003
Closed

Application crash caused by ChatGPT-3.5 Turbo and ChatGPT-4 #2002

mishinev opened this issue Feb 22, 2024 · 14 comments · Fixed by #2003
Labels
bug Something isn't working chat gpt4all-chat issues

Comments

@mishinev
Copy link

Bug Report

After I upgraded GPT4All from V2.7.0 to V2.7.1, the application started to crash every time I tried to run it. Removing all the models helped and the application ran seamlessly. I started to return the models one by one. Everything worked OK until I returned chatgpt-gpt-3.5-turbo.txt into the model directory. I received the same result with bringing back chatgpt-gpt-4.txt. I tried to add OpenAI API key to "ChatGPT-3.5 Turbo" and the application crashed immediately. Trying to add the key to ChatGPT-4 led to the same result.

The error log show this message:

gguf_init_from_file: invalid magic characters 'sk-x'
load_gguf: gguf_init_from_file failed
zsh: segmentation fault /Applications/gpt4all/bin/gpt4all.app/Contents/MacOS/gpt4all

My API key begins like this:

sk-xZu.....

Steps to Reproduce

  1. Run GPT4All
  2. Add API key to either ChatGPT-3.5 Turbo or ChatGPT-4
  3. The application crashes

Expected Behavior

Your Environment

  • GPT4All version: 2.7.2
  • Operating System: macOS Sonoma 14.3.1 (23D60)
  • Chat model used (if applicable): ChatGPT-3.5 Turbo and ChatGPT-4
@mishinev mishinev added bug-unconfirmed chat gpt4all-chat issues labels Feb 22, 2024
@apage43
Copy link
Member

apage43 commented Feb 22, 2024

repros for me if chatgpt key is the only model i have:

❯ lldb ./build/bin/gpt4all.app/Contents/MacOS/gpt4all
(lldb) target create "./build/bin/gpt4all.app/Contents/MacOS/gpt4all"
Current executable set to '/Users/aaron/proj/gpt4all/gpt4all-chat/build/bin/gpt4all.app/Contents/MacOS/gpt4all' (arm64).
(lldb) run
Process 75627 launched: '/Users/aaron/proj/gpt4all/gpt4all-chat/build/bin/gpt4all.app/Contents/MacOS/gpt4all' (arm64)
availableGPUDevices: built without Kompute
[Debug] (Thu Feb 22 09:39:04 2024): deserializing chats took: 0 ms
[Warning] (Thu Feb 22 09:39:05 2024): Populating font family aliases took 158 ms. Replace uses of missing font family "MyCustomFont, Sans-serif" with one that exists to avoid this cost. 
gguf_init_from_file: invalid magic characters 'sk-e'
load_gguf: gguf_init_from_file failed
Process 75627 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x000000010a76310c libllamamodel-mainline-default.dylib`gguf_find_key + 16
libllamamodel-mainline-default.dylib`gguf_find_key:
->  0x10a76310c <+16>: ldr    x8, [x0, #0x10]
    0x10a763110 <+20>: cmp    w8, #0x1
    0x10a763114 <+24>: b.lt   0x10a76314c               ; <+80>
    0x10a763118 <+28>: mov    x20, x1
Target 0: (gpt4all) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x000000010a76310c libllamamodel-mainline-default.dylib`gguf_find_key + 16
    frame #1: 0x000000010a7377d4 libllamamodel-mainline-default.dylib`get_arch_name(gguf_context*) + 36
    frame #2: 0x000000010a739108 libllamamodel-mainline-default.dylib`get_arch_key_u32(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 68
    frame #3: 0x000000010a73938c libllamamodel-mainline-default.dylib`LLamaModel::layerCount(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const + 68
    frame #4: 0x00000001000704a4 gpt4all`ModelInfo::maxGpuLayers() const + 240
    frame #5: 0x0000000100013878 gpt4all`ModelInfo::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 1740
    frame #6: 0x00000001027b8258 QtQml`QV4::getGadgetProperty(QV4::ExecutionEngine*, QV4::Heap::QQmlValueTypeWrapper*, QMetaType, unsigned short, bool, bool) + 220

@manyoso
Copy link
Collaborator

manyoso commented Feb 22, 2024

image

@cebtenzzre cebtenzzre linked a pull request Feb 22, 2024 that will close this issue
@manyoso
Copy link
Collaborator

manyoso commented Feb 22, 2024

This is fixed and merged.

@cebtenzzre cebtenzzre added bug Something isn't working and removed bug-unconfirmed labels Feb 26, 2024
@cebtenzzre
Copy link
Member

Reopening for visibility until the next release.

@cebtenzzre cebtenzzre reopened this Feb 26, 2024
@cebtenzzre cebtenzzre added the awaiting-release issue is awaiting next release label Feb 26, 2024
@anthonyonazure
Copy link

Is there a workaround for this until the next release? I chose CGPT4 during my initial setup and even though I have uninstalled/reinstalled/uninstalled/cleared cache/chose a diff dir/etc. chat.exe starts for a few seconds and then dies.

@cebtenzzre
Copy link
Member

Is there a workaround for this until the next release?

You can delete chatgpt-gpt-4.txt from the model directory, or downgrade to v2.7.0 by downloading it from here.

@SheMelody
Copy link

This problem is still present, in Windows as well, and most likely other platforms. One way to make it work is to install an actual model first (such as Mistral Instruct), restart the application, then install your openai key.

@NaturallyAsh
Copy link

NaturallyAsh commented Mar 1, 2024

The crash is still happening. Following @SheMelody 's instructions did work. But then the app crashed when I went to Settings > Models and then clicked ChatGPT from the Model/Character dropdown.

Macbook M1 Pro

@SheMelody
Copy link

SheMelody commented Mar 2, 2024

The crash is still happening. Following @SheMelody 's instructions did work. But then the app crashed when I went to Settings > Models and then clicked ChatGPT from the Model/Character dropdown.

Macbook M1 Pro

When I performed my tests, I simply deleted folders in %localappdata%\nomic.ai and %appdata%\nomic.ai. You could try removing the line that loads the "default" model from %appdata%\nomic.ai\GPT4ALL.ini, if the app saves it there. For linux, if I remember correctly, it should be somewhere in $HOME/.config/. No idea about Mac.

@mriamnobody
Copy link

The crash is still happening. Following @SheMelody 's instructions did work. But then the app crashed when I went to Settings > Models and then clicked ChatGPT from the Model/Character dropdown.
Macbook M1 Pro

When I performed my tests, I simply deleted folders in %localappdata%\nomic.ai and %appdata%\nomic.ai. You could try removing the line that loads the "default" model from %appdata%\nomic.ai\GPT4ALL.ini, if the app saves it there. For linux, if I remember correctly, it should be somewhere in $HOME/.config/. No idea about Mac.

Thanks a lot @SheMelody. This worked for me.

@seajaysec
Copy link

seajaysec commented Mar 5, 2024

This is still broken in the current release. Is the plan to require everyone affected to follow these recommended workarounds or will the proposed fix clean things up itself?

edit: I ask because I cannot get the workarounds to work, which seems like a common report.

@NaturallyAsh
Copy link

The second workaround still doesn't work for my MacBook M1 Pro. Crashes when I click the drop down in Settings > Models

@SheMelody
Copy link

The second workaround still doesn't work for my MacBook M1 Pro. Crashes when I click the drop down in Settings > Models

It will crash if you go to settings and click on ChatGPT-4 model. Chances are if this is already selected (for some reason) you will just instantly crash when opening settings. I don't know an exact fix for this but you should try checking the GPT4ALL.ini file out (see my post above).

@cebtenzzre
Copy link
Member

This was fixed in the v2.7.2 release (offline installers coming soon).

@cebtenzzre cebtenzzre removed the awaiting-release issue is awaiting next release label Mar 6, 2024
@cebtenzzre cebtenzzre unpinned this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chat gpt4all-chat issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants