Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
5fa36a08
Unverified
Commit
5fa36a08
authored
May 15, 2024
by
Daniel Hiltgen
Committed by
GitHub
May 15, 2024
Browse files
Merge pull request #4459 from dhiltgen/sanitize_env_log
Sanitize the env var debug log
parents
f2cf97d6
853ae490
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
llm/server.go
llm/server.go
+16
-2
No files found.
llm/server.go
View file @
5fa36a08
...
...
@@ -317,8 +317,22 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
}
slog
.
Info
(
"starting llama server"
,
"cmd"
,
s
.
cmd
.
String
())
// Log at debug as the environment is inherited and might contain sensitive information
slog
.
Debug
(
"subprocess"
,
"environment"
,
s
.
cmd
.
Env
)
if
envconfig
.
Debug
{
filteredEnv
:=
[]
string
{}
for
_
,
ev
:=
range
s
.
cmd
.
Env
{
if
strings
.
HasPrefix
(
ev
,
"CUDA_"
)
||
strings
.
HasPrefix
(
ev
,
"ROCM_"
)
||
strings
.
HasPrefix
(
ev
,
"HIP_"
)
||
strings
.
HasPrefix
(
ev
,
"HSA_"
)
||
strings
.
HasPrefix
(
ev
,
"GGML_"
)
||
strings
.
HasPrefix
(
ev
,
"PATH="
)
||
strings
.
HasPrefix
(
ev
,
"LD_LIBRARY_PATH="
)
{
filteredEnv
=
append
(
filteredEnv
,
ev
)
}
}
// Log at debug as the environment is inherited and might contain sensitive information
slog
.
Debug
(
"subprocess"
,
"environment"
,
filteredEnv
)
}
if
err
=
s
.
cmd
.
Start
();
err
!=
nil
{
// Detect permission denied and augment them essage about noexec
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment