fix: prevent terminal window from opening on model load on WindowsOS (#5837)
On Windows, spawning the llamacpp server was causing an unwanted terminal window to appear. This is now fixed by combining `CREATE_NO_WINDOW` with `CREATE_NEW_PROCESS_GROUP` using `.creation_flags(...)`, ensuring that the process runs in the background without a console window. This change only applies to 64-bit Windows builds.
This commit is contained in:
parent
05b9d4e9fd
commit
08de0fa42d
@ -144,8 +144,9 @@ pub async fn load_llama_model(
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
{
|
||||
use std::os::windows::process::CommandExt;
|
||||
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
|
||||
const CREATE_NEW_PROCESS_GROUP: u32 = 0x0000_0200;
|
||||
command.creation_flags(CREATE_NEW_PROCESS_GROUP);
|
||||
command.creation_flags(CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP);
|
||||
}
|
||||
|
||||
// Spawn the child process
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user