-
Notifications
You must be signed in to change notification settings - Fork 55
Fixing build and defaulting models.home #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b7626c2
95599d9
86cf3a5
8c979a5
e94a2a1
aeb38c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,9 @@ else() | |
| set(LLAMA_METAL_DEFAULT OFF) | ||
| endif() | ||
|
|
||
| # general | ||
| option(LLAMA_NATIVE "llama: enable -march=native flag" ON) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm genuinely not sure why this caused issues. If you have ideas or alternative approaches, do let me know. |
||
|
|
||
| # instruction set specific | ||
| if (LLAMA_NATIVE) | ||
| set(INS_ENB OFF) | ||
|
|
@@ -633,4 +636,4 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") | |
| endif() | ||
| if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") | ||
| add_compile_definitions(_BSD_SOURCE) | ||
| endif() | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Local Model Directory | ||
| This directory contains models which will be automatically downloaded | ||
| for use in java-llama.cpp's unit tests. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,8 @@ public void testGenerateGrammar() { | |
| String output = sb.toString(); | ||
|
|
||
| Assert.assertTrue(output.matches("[ab]+")); | ||
| Assert.assertEquals(nPredict, model.encode(output).length); | ||
| int generated = model.encode(output).length; | ||
| Assert.assertTrue(generated > 0 && generated <= nPredict); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose the number of tokens generated parameter is an upper bound rather than a guarantee. It's consistently off by 1 in the 2 bit quantization. |
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -126,7 +127,8 @@ public void testCompleteGrammar() { | |
| .setNPredict(nPredict); | ||
| String output = model.complete("", params); | ||
| Assert.assertTrue(output.matches("[ab]+")); | ||
| Assert.assertEquals(nPredict, model.encode(output).length); | ||
| int generated = model.encode(output).length; | ||
| Assert.assertTrue(generated > 0 && generated <= nPredict); | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure we don't accidentally check in a chonker .gguf file.