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
1deafd82
Unverified
Commit
1deafd82
authored
Jan 08, 2025
by
Jeffrey Morgan
Committed by
GitHub
Jan 08, 2025
Browse files
llama: update vendored code to commit 46e3556 (#8308)
parent
57f038ec
Changes
305
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
16 deletions
+48
-16
llama/unicode.h
llama/unicode.h
+10
-11
llama/vendoring
llama/vendoring
+1
-1
llm/server.go
llm/server.go
+0
-1
make/Makefile.sync
make/Makefile.sync
+29
-3
parser/parser.go
parser/parser.go
+8
-0
No files found.
llama/unicode.h
View file @
1deafd82
/**
/**
* llama.cpp - commit
ba1cb19cdd0d92e012e0f6e009e0620f854b6afd
- do not edit this file
* llama.cpp - commit
46e3556e01b824e52395fb050b29804b6cff2a7c
- do not edit this file
*
*
* MIT License
* MIT License
*
*
...
@@ -30,9 +30,7 @@
...
@@ -30,9 +30,7 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
// TODO: prefix all symbols with "llama_"
struct
unicode_cpt_flags
{
struct
codepoint_flags
{
enum
{
enum
{
UNDEFINED
=
0x0001
,
UNDEFINED
=
0x0001
,
NUMBER
=
0x0002
,
// regex: \p{N}
NUMBER
=
0x0002
,
// regex: \p{N}
...
@@ -61,7 +59,7 @@ struct codepoint_flags {
...
@@ -61,7 +59,7 @@ struct codepoint_flags {
uint16_t
is_nfd
:
1
;
uint16_t
is_nfd
:
1
;
// decode from uint16
// decode from uint16
inline
code
poin
t_flags
(
const
uint16_t
flags
=
0
)
{
inline
uni
code
_cp
t_flags
(
const
uint16_t
flags
=
0
)
{
*
reinterpret_cast
<
uint16_t
*>
(
this
)
=
flags
;
*
reinterpret_cast
<
uint16_t
*>
(
this
)
=
flags
;
}
}
...
@@ -76,18 +74,19 @@ struct codepoint_flags {
...
@@ -76,18 +74,19 @@ struct codepoint_flags {
size_t
unicode_len_utf8
(
char
src
);
size_t
unicode_len_utf8
(
char
src
);
std
::
string
unicode_cpt_to_utf8
(
uint32_t
cp
);
std
::
string
unicode_cpt_to_utf8
(
uint32_t
cpt
);
uint32_t
unicode_cpt_from_utf8
(
const
std
::
string
&
utf8
,
size_t
&
offset
);
uint32_t
unicode_cpt_from_utf8
(
const
std
::
string
&
utf8
,
size_t
&
offset
);
std
::
vector
<
uint32_t
>
unicode_cpts_from_utf8
(
const
std
::
string
&
utf8
);
std
::
vector
<
uint32_t
>
unicode_cpts_from_utf8
(
const
std
::
string
&
utf8
);
std
::
vector
<
uint32_t
>
unicode_cpts_normalize_nfd
(
const
std
::
vector
<
uint32_t
>
&
cpts
);
std
::
vector
<
uint32_t
>
unicode_cpts_normalize_nfd
(
const
std
::
vector
<
uint32_t
>
&
cpts
);
code
poin
t_flags
unicode_cpt_flags
(
cons
t
uint32_t
cp
);
uni
code
_cp
t_flags
unicode_cpt_flags
_from_cp
t
(
uint32_t
cp
t
);
code
poin
t_flags
unicode_cpt_flags
(
const
std
::
string
&
utf8
);
uni
code
_cp
t_flags
unicode_cpt_flags
_from_utf8
(
const
std
::
string
&
utf8
);
std
::
string
unicode_byte_to_utf8
(
uint8_t
byte
);
std
::
string
unicode_byte_to_utf8
(
uint8_t
byte
);
uint8_t
unicode_utf8_to_byte
(
const
std
::
string
&
utf8
);
uint8_t
unicode_utf8_to_byte
(
const
std
::
string
&
utf8
);
uint32_t
unicode_tolower
(
uint32_t
cp
);
uint32_t
unicode_tolower
(
uint32_t
cp
t
);
std
::
vector
<
std
::
string
>
unicode_regex_split
(
const
std
::
string
&
text
,
const
std
::
vector
<
std
::
string
>
&
regex_exprs
);
std
::
vector
<
std
::
string
>
unicode_regex_split
(
const
std
::
string
&
text
,
const
std
::
vector
<
std
::
string
>
&
regex_exprs
);
llama/vendoring
View file @
1deafd82
LLAMACPP_BASE_COMMIT=
ba1cb19cdd0d92e012e0f6e009e0620f854b6afd
LLAMACPP_BASE_COMMIT=
46e3556e01b824e52395fb050b29804b6cff2a7c
llm/server.go
View file @
1deafd82
...
@@ -692,7 +692,6 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
...
@@ -692,7 +692,6 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
"mirostat"
:
req
.
Options
.
Mirostat
,
"mirostat"
:
req
.
Options
.
Mirostat
,
"mirostat_tau"
:
req
.
Options
.
MirostatTau
,
"mirostat_tau"
:
req
.
Options
.
MirostatTau
,
"mirostat_eta"
:
req
.
Options
.
MirostatEta
,
"mirostat_eta"
:
req
.
Options
.
MirostatEta
,
"penalize_nl"
:
req
.
Options
.
PenalizeNewline
,
"seed"
:
req
.
Options
.
Seed
,
"seed"
:
req
.
Options
.
Seed
,
"stop"
:
req
.
Options
.
Stop
,
"stop"
:
req
.
Options
.
Stop
,
"image_data"
:
req
.
Images
,
"image_data"
:
req
.
Images
,
...
...
make/Makefile.sync
View file @
1deafd82
...
@@ -78,14 +78,40 @@ LLAMACPP_FILES=\
...
@@ -78,14 +78,40 @@ LLAMACPP_FILES=\
src/unicode-data.cpp
\
src/unicode-data.cpp
\
src/unicode-data.h
\
src/unicode-data.h
\
src/llama.cpp
\
src/llama.cpp
\
src/llama-impl.h
\
src/llama-adapter.cpp
\
src/llama-vocab.cpp
\
src/llama-adapter.h
\
src/llama-vocab.h
\
src/llama-arch.cpp
\
src/llama-arch.h
\
src/llama-batch.cpp
\
src/llama-batch.h
\
src/llama-chat.cpp
\
src/llama-chat.h
\
src/llama-context.cpp
\
src/llama-context.h
\
src/llama-cparams.cpp
\
src/llama-cparams.h
\
src/llama-grammar.cpp
\
src/llama-grammar.cpp
\
src/llama-grammar.h
\
src/llama-grammar.h
\
src/llama-hparams.cpp
\
src/llama-hparams.h
\
src/llama-impl.cpp
\
src/llama-impl.h
\
src/llama-kv-cache.cpp
\
src/llama-kv-cache.h
\
src/llama-mmap.cpp
\
src/llama-mmap.h
\
src/llama-model-loader.cpp
\
src/llama-model-loader.h
\
src/llama-model.cpp
\
src/llama-model.h
\
src/llama-quant.cpp
\
src/llama-quant.h
\
src/llama-sampling.cpp
\
src/llama-sampling.cpp
\
src/llama-sampling.h
\
src/llama-sampling.h
\
src/llama-vocab.cpp
\
src/llama-vocab.h
\
include/llama.h
\
include/llama.h
\
include/llama-cpp.h
\
ggml/include/ggml-cpu.h
\
ggml/include/ggml-cpu.h
\
ggml/src/ggml-cpu/llamafile/sgemm.cpp
\
ggml/src/ggml-cpu/llamafile/sgemm.cpp
\
ggml/src/ggml-cpu/llamafile/sgemm.h
ggml/src/ggml-cpu/llamafile/sgemm.h
...
...
parser/parser.go
View file @
1deafd82
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
"os"
"os"
"os/user"
"os/user"
"path/filepath"
"path/filepath"
"slices"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -35,6 +36,8 @@ func (f Modelfile) String() string {
...
@@ -35,6 +36,8 @@ func (f Modelfile) String() string {
return
sb
.
String
()
return
sb
.
String
()
}
}
var
deprecatedParameters
=
[]
string
{
"penalize_newline"
}
// CreateRequest creates a new *api.CreateRequest from an existing Modelfile
// CreateRequest creates a new *api.CreateRequest from an existing Modelfile
func
(
f
Modelfile
)
CreateRequest
()
(
*
api
.
CreateRequest
,
error
)
{
func
(
f
Modelfile
)
CreateRequest
()
(
*
api
.
CreateRequest
,
error
)
{
req
:=
&
api
.
CreateRequest
{}
req
:=
&
api
.
CreateRequest
{}
...
@@ -82,6 +85,11 @@ func (f Modelfile) CreateRequest() (*api.CreateRequest, error) {
...
@@ -82,6 +85,11 @@ func (f Modelfile) CreateRequest() (*api.CreateRequest, error) {
role
,
msg
,
_
:=
strings
.
Cut
(
c
.
Args
,
": "
)
role
,
msg
,
_
:=
strings
.
Cut
(
c
.
Args
,
": "
)
messages
=
append
(
messages
,
api
.
Message
{
Role
:
role
,
Content
:
msg
})
messages
=
append
(
messages
,
api
.
Message
{
Role
:
role
,
Content
:
msg
})
default
:
default
:
if
slices
.
Contains
(
deprecatedParameters
,
c
.
Name
)
{
fmt
.
Printf
(
"warning: parameter %s is deprecated
\n
"
,
c
.
Name
)
break
}
ps
,
err
:=
api
.
FormatParams
(
map
[
string
][]
string
{
c
.
Name
:
{
c
.
Args
}})
ps
,
err
:=
api
.
FormatParams
(
map
[
string
][]
string
{
c
.
Name
:
{
c
.
Args
}})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
Prev
1
…
12
13
14
15
16
Next
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