gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Fix BOS error and crash on model creation error

Open mvenditto opened this issue 1 year ago • 3 comments

Describe your changes

  • Reuse context between text completion requests. Fixes the BOS error for Hermes and similar.
    • Closes #996
    • Addresses https://github.com/nomic-ai/gpt4all/issues/649#issuecomment-1572128068
  • Fix a crash when the backend reports an error on llmodel_model_create2 and expose LLModel::SetImplementationSearchPath.
    • Closes #1062

Breaking Changes

  • Removed PredictRequestOptions parameter from ITextPrediction methods.
    • IGpt4AllModel interface now exposes an LLModelPromptContext used for all the request.

    Before the context used to be recreated for each request.

  • IGpt4AllModelFactory.LoadModel now can throw more specific exceptions:
    • ModelLoadException
    • ModelCreationException (with the underlying error code/message)

Issue ticket number and link

Checklist before requesting a review

  • [x] I have performed a self-review of my code.
  • [ ] If it is a core feature, I have added thorough tests.
  • [ ] I have added thorough documentation for my code.
  • [x] I have tagged PR with relevant project labels. I acknowledge that a PR without labels may be dismissed.
  • [x] If this PR addresses a bug, I have provided both a screenshot/video of the original bug and the working solution.

Demo

Steps to Reproduce

Notes

mvenditto avatar Jun 27 '23 19:06 mvenditto

Is this ready?

manyoso avatar Jul 03 '23 12:07 manyoso

Is this ready?

Tested a couple more things. ready now

mvenditto avatar Jul 03 '23 20:07 mvenditto

Re the IGpt4AllModel interface change - are you absolutely sure you want to expose that low-level type as part of this high-level API? Feels like the design of this lib so far is that all of the stuff in Bindings is encapsulated and hidden away by the higher-level stuff. You'd be breaking that with this change. IMO PredictRequestOptions does serve a purpose - it's just that it should probably be scoped to a Gpt4All (or something higher-level, anyway - don't know if you've considered something like adding something along the lines of ITextPrediction IGpt4AllModel.CreatePredictionContext(opts)) rather than an individual prediction request?

sdcondon avatar Dec 31 '23 12:12 sdcondon

Is this out of date and to be closed?

manyoso avatar Mar 06 '24 18:03 manyoso

mvenditto hasn't been active here in a long time - we can close this.

cebtenzzre avatar Mar 06 '24 19:03 cebtenzzre