gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Download of models freezing

Open Vuizur opened this issue 1 year ago • 4 comments

System Info

Python 3.10, Windows 11, GPT4all 2.4.10

Information

  • [ ] The official example notebooks/scripts
  • [ ] My own modified scripts

Related Components

  • [X] backend
  • [ ] bindings
  • [ ] python-bindings
  • [X] chat-ui
  • [ ] models
  • [ ] circleci
  • [ ] docker
  • [ ] api

Reproduction

My internet apparently is not extremely stable, but other programs manage to download large files without any errors.

With GPT4all I have the problem that when I click on "Download" in the GUI, it downloads about 40 percent and then freezes, the client doesn't seem to get more data from the server.

Expected behavior

The freezing is caused by requests.get() in download_model() not having a timeout parameter, so when the server for some reason stops sending data the program hangs forever. A timeout would fix this. If we make sure that this kind of error does not cause the uncompleted file to get deleted, the user could resume the download by clicking on the "Resume" button, which is already implemented and works fine.

Even better would be to have functionality that automatically retries from the last point, the solution would be more difficult and would probably need to look like this or so.

Vuizur avatar Jul 07 '23 09:07 Vuizur

I also noticed that when you download a model and the download fails with an error, the download button changes to "Remove". However, when you close the application and open it again, you get the option to resume the download.

Vuizur avatar Jul 07 '23 13:07 Vuizur

... The freezing is caused by requests.get() in download_model() not having a timeout parameter, so when the server for some reason stops sending data the program hangs forever. A timeout would fix this. ...

I think you're mixing up things there. The Python bindings can download, too, but that implementation is separate from the GUI, which uses Qt APIs. See: gpt4all/gpt4all-chat/download.cpp.

cosmic-snow avatar Jul 07 '23 15:07 cosmic-snow

Thanks for the reply!

Oh, that is true.

I quickly ran the Python code to test my suspicion, and could replicate that without the timeout it freezes forever and that with the timeout it throws an error.

I think it might be plausible that the timeout is also the reason for QT, but no idea how to fix it. (The python requests timeouts cause an error if the server failed to send any data in the last X seconds, so it doesn't discriminate against connections that are merely slow. But I don't know if QT has the same feature.)

Vuizur avatar Jul 07 '23 18:07 Vuizur

I also noticed that when you download a model and the download fails with an error, the download button changes to "Remove". However, when you close the application and open it again, you get the option to resume the download.

i have this exact same issue, any solutions found yet?

laughingwater avatar Nov 15 '23 15:11 laughingwater