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
50566113
"test/torchscript_consistency_impl.py" did not exist on "b95d60c24ef7a2a8f2441a602a375f14e6b4bc6d"
Unverified
Commit
50566113
authored
Feb 03, 2025
by
Jeffrey Morgan
Committed by
GitHub
Feb 03, 2025
Browse files
llm: do not error if LibOllamaPath does not exist (#8801)
parent
ad22ace4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
llm/server.go
llm/server.go
+3
-14
No files found.
llm/server.go
View file @
50566113
...
...
@@ -89,7 +89,6 @@ func LoadModel(model string, maxArraySize int) (*GGML, error) {
// NewLlamaServer will run a server for the given GPUs
// The gpu list must be a single family.
func
NewLlamaServer
(
gpus
discover
.
GpuInfoList
,
model
string
,
ggml
*
GGML
,
adapters
,
projectors
[]
string
,
opts
api
.
Options
,
numParallel
int
)
(
LlamaServer
,
error
)
{
var
err
error
var
systemTotalMemory
uint64
var
systemFreeMemory
uint64
var
systemSwapFreeMemory
uint64
...
...
@@ -233,19 +232,9 @@ func NewLlamaServer(gpus discover.GpuInfoList, model string, ggml *GGML, adapter
params
=
append
(
params
,
"--multiuser-cache"
)
}
// get available libraries
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"could not get libollama dir: %w"
,
err
)
}
entries
,
err
:=
os
.
ReadDir
(
discover
.
LibOllamaPath
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"could not read libollama dir: %w"
,
err
)
}
libs
:=
make
(
map
[
string
]
string
)
for
_
,
entry
:=
range
entries
{
if
entry
.
IsDir
()
{
if
entries
,
err
:=
os
.
ReadDir
(
discover
.
LibOllamaPath
);
err
==
nil
{
for
_
,
entry
:=
range
entries
{
libs
[
entry
.
Name
()]
=
filepath
.
Join
(
discover
.
LibOllamaPath
,
entry
.
Name
())
}
}
...
...
@@ -285,7 +274,7 @@ func NewLlamaServer(gpus discover.GpuInfoList, model string, ggml *GGML, adapter
}
}
if
port
==
0
{
slog
.
Debug
(
"ResolveTCPAddr failed
"
,
"error"
,
err
)
slog
.
Debug
(
"ResolveTCPAddr failed
, using random port"
)
port
=
rand
.
Intn
(
65535
-
49152
)
+
49152
// get a random port in the ephemeral range
}
finalParams
:=
[]
string
{
"runner"
}
...
...
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