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
9771b1ec
Unverified
Commit
9771b1ec
authored
Sep 29, 2023
by
Bruce MacDonald
Committed by
GitHub
Sep 29, 2023
Browse files
windows runner fixes (#637)
parent
76db4a49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
llm/llama.go
llm/llama.go
+7
-4
No files found.
llm/llama.go
View file @
9771b1ec
...
...
@@ -64,27 +64,29 @@ func chooseRunners(workDir, runnerType string) []ModelRunner {
runnerAvailable
:=
false
// if no runner files are found in the embed, this flag will cause a fast fail
for
_
,
r
:=
range
runners
{
// find all the files in the runner's bin directory
files
,
err
:=
fs
.
Glob
(
llamaCppEmbed
,
file
path
.
Join
(
file
path
.
Dir
(
r
),
"*"
))
files
,
err
:=
fs
.
Glob
(
llamaCppEmbed
,
path
.
Join
(
path
.
Dir
(
r
),
"*"
))
if
err
!=
nil
{
// this is expected, ollama may be compiled without all runners packed in
log
.
Printf
(
"%s runner not found: %v"
,
r
,
err
)
continue
}
runnerAvailable
=
true
for
_
,
f
:=
range
files
{
runnerAvailable
=
true
srcFile
,
err
:=
llamaCppEmbed
.
Open
(
f
)
if
err
!=
nil
{
log
.
Fatalf
(
"read llama runner %s: %v"
,
f
,
err
)
}
defer
srcFile
.
Close
()
// create the directory in case it does not exist
// create the directory in case it does not exist
, filepath.Dir() converts the file path to the OS's format
destPath
:=
filepath
.
Join
(
workDir
,
filepath
.
Dir
(
f
))
if
err
:=
os
.
MkdirAll
(
destPath
,
0
o755
);
err
!=
nil
{
log
.
Fatalf
(
"create runner temp dir %s: %v"
,
filepath
.
Dir
(
f
),
err
)
}
// create the path to the destination file, filepath.Base() converts the file path to the OS's format
destFile
:=
filepath
.
Join
(
destPath
,
filepath
.
Base
(
f
))
_
,
err
=
os
.
Stat
(
destFile
)
...
...
@@ -111,7 +113,8 @@ func chooseRunners(workDir, runnerType string) []ModelRunner {
// return the runners to try in priority order
localRunnersByPriority
:=
[]
ModelRunner
{}
for
_
,
r
:=
range
runners
{
localRunnersByPriority
=
append
(
localRunnersByPriority
,
ModelRunner
{
Path
:
path
.
Join
(
workDir
,
r
)})
// clean the ModelRunner paths so that they match the OS we are running on
localRunnersByPriority
=
append
(
localRunnersByPriority
,
ModelRunner
{
Path
:
filepath
.
Clean
(
path
.
Join
(
workDir
,
r
))})
}
return
localRunnersByPriority
...
...
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