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
c5f7eadd
Commit
c5f7eadd
authored
Jul 11, 2023
by
Michael Yang
Browse files
error checking new model
parent
7226980f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
llama/llama.go
llama/llama.go
+7
-0
No files found.
llama/llama.go
View file @
c5f7eadd
...
...
@@ -123,7 +123,14 @@ func New(model string, opts api.Options) (*llama, error) {
defer
C
.
free
(
unsafe
.
Pointer
(
cModel
))
llm
.
model
=
C
.
llama_load_model_from_file
(
cModel
,
params
)
if
llm
.
model
==
nil
{
return
nil
,
errors
.
New
(
"failed to load model"
)
}
llm
.
ctx
=
C
.
llama_new_context_with_model
(
llm
.
model
,
params
)
if
llm
.
ctx
==
nil
{
return
nil
,
errors
.
New
(
"failed to create context"
)
}
// warm up the model
bos
:=
[]
C
.
llama_token
{
C
.
llama_token_bos
()}
...
...
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