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
884d2609
Unverified
Commit
884d2609
authored
May 22, 2025
by
Parth Sareen
Committed by
GitHub
May 22, 2025
Browse files
llama: add minimum memory for grammar (#10820)
parent
1f371ea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
llama/llama.go
llama/llama.go
+1
-1
No files found.
llama/llama.go
View file @
884d2609
...
...
@@ -580,7 +580,7 @@ func SchemaToGrammar(schema []byte) []byte {
defer
C
.
free
(
unsafe
.
Pointer
(
cStr
))
// Allocate buffer for grammar based on schema length but with upper bound
maxLen
:=
min
(
1024
*
1024
,
len
(
schema
)
*
4
)
maxLen
:=
max
(
32768
,
min
(
1024
*
1024
,
len
(
schema
)
*
4
)
)
buf
:=
make
([]
byte
,
maxLen
)
// Call C function to convert schema to grammar
...
...
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