forked from ollama/ollama
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable windows error dialog for subprocess startup
Make sure if something goes wrong spawning the process, the user gets enough info to be able to try to self correct, or at least file a bug with details so we can fix it. Once the process starts, we immediately change back to the recommended setting to prevent the blocking dialog. This ensures if the model fails to load (OOM, unsupported model type, etc.) the process will exit quickly and we can scan the stdout/stderr of the subprocess for the reason to report via API.
- Loading branch information
Showing
6 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
package llm | ||
|
||
import "embed" | ||
import ( | ||
"embed" | ||
"syscall" | ||
) | ||
|
||
//go:embed build/linux/*/*/bin/* | ||
var libEmbed embed.FS | ||
|
||
var LlamaServerSysProcAttr = &syscall.SysProcAttr{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
package llm | ||
|
||
import "embed" | ||
import ( | ||
"embed" | ||
"syscall" | ||
) | ||
|
||
// unused on windows | ||
var libEmbed embed.FS | ||
|
||
const CREATE_DEFAULT_ERROR_MODE = 0x04000000 | ||
|
||
var LlamaServerSysProcAttr = &syscall.SysProcAttr{ | ||
// Wire up the default error handling logic If for some reason a DLL is | ||
// missing in the path this will pop up a GUI Dialog explaining the fault so | ||
// the user can either fix their PATH, or report a bug. Without this | ||
// setting, the process exits immediately with a generic exit status but no | ||
// way to (easily) figure out what the actual missing DLL was. | ||
CreationFlags: CREATE_DEFAULT_ERROR_MODE, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters