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
09d8bf67
Commit
09d8bf67
authored
Aug 09, 2023
by
Bruce MacDonald
Browse files
fix build errors
parent
7a5f3616
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
llama/llama.go
llama/llama.go
+1
-1
server/routes.go
server/routes.go
+2
-2
No files found.
llama/llama.go
View file @
09d8bf67
...
@@ -416,7 +416,7 @@ func (llm *LLM) Embedding(input string) ([]float64, error) {
...
@@ -416,7 +416,7 @@ func (llm *LLM) Embedding(input string) ([]float64, error) {
return
nil
,
errors
.
New
(
"llama: embedding not enabled"
)
return
nil
,
errors
.
New
(
"llama: embedding not enabled"
)
}
}
tokens
:=
llm
.
tokeniz
e
(
input
)
tokens
:=
llm
.
Encod
e
(
input
)
if
tokens
==
nil
{
if
tokens
==
nil
{
return
nil
,
errors
.
New
(
"llama: tokenize embedding"
)
return
nil
,
errors
.
New
(
"llama: tokenize embedding"
)
}
}
...
...
server/routes.go
View file @
09d8bf67
...
@@ -87,13 +87,13 @@ func GenerateHandler(c *gin.Context) {
...
@@ -87,13 +87,13 @@ func GenerateHandler(c *gin.Context) {
}
}
if
opts
.
NumKeep
<
0
{
if
opts
.
NumKeep
<
0
{
promptWithSystem
,
err
:=
model
.
Prompt
(
api
.
GenerateRequest
{})
promptWithSystem
,
err
:=
model
.
Prompt
(
api
.
GenerateRequest
{}
,
""
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
return
}
}
promptNoSystem
,
err
:=
model
.
Prompt
(
api
.
GenerateRequest
{
Context
:
[]
int
{
0
}})
promptNoSystem
,
err
:=
model
.
Prompt
(
api
.
GenerateRequest
{
Context
:
[]
int
{
0
}}
,
""
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
return
...
...
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