Commit e3c337d
authored
llama : support negative ith in llama_get_ API (#6519)
* llama_sampling_sample with default args is more naively usable
* Batches populated by either llama_batch_get_one or llama_batch_add work with default args
* Previously get_one could use the default argument
* Previously add should usually have used the last index where logits[idx] == true
* This hopefully encourages the use of llama_batch_add
* By giving expected results when using default arguments.
* Adds "negative indexing" feature to llama_get_logits_ith and llama_get_embeddings_ith
* Believed to work with any currently well behaved program
* Default arg now works for both cases (previously would give strange results for add case)
* Any non-negative number is unaffected and behaves as previously
* Negative arguments were previously invalid.
* Implemented as a special case of indexing as suggested by @compilade in #6519
* Fixed mismatch type errors
* cited in macOS CI tests
* Missed in original updates based on PR feedback in #65191 parent beea6e1 commit e3c337d
3 files changed
+34
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2177 | 2177 | | |
2178 | 2178 | | |
2179 | 2179 | | |
2180 | | - | |
| 2180 | + | |
2181 | 2181 | | |
2182 | 2182 | | |
2183 | 2183 | | |
| |||
10411 | 10411 | | |
10412 | 10412 | | |
10413 | 10413 | | |
| 10414 | + | |
| 10415 | + | |
| 10416 | + | |
10414 | 10417 | | |
10415 | 10418 | | |
10416 | 10419 | | |
| |||
15944 | 15947 | | |
15945 | 15948 | | |
15946 | 15949 | | |
| 15950 | + | |
15947 | 15951 | | |
15948 | 15952 | | |
15949 | 15953 | | |
15950 | 15954 | | |
15951 | 15955 | | |
15952 | 15956 | | |
15953 | | - | |
| 15957 | + | |
| 15958 | + | |
| 15959 | + | |
| 15960 | + | |
| 15961 | + | |
| 15962 | + | |
| 15963 | + | |
15954 | 15964 | | |
| 15965 | + | |
| 15966 | + | |
15955 | 15967 | | |
15956 | | - | |
15957 | 15968 | | |
15958 | 15969 | | |
15959 | 15970 | | |
15960 | 15971 | | |
15961 | | - | |
| 15972 | + | |
15962 | 15973 | | |
15963 | | - | |
| 15974 | + | |
15964 | 15975 | | |
15965 | 15976 | | |
15966 | 15977 | | |
| |||
15980 | 15991 | | |
15981 | 15992 | | |
15982 | 15993 | | |
| 15994 | + | |
| 15995 | + | |
15983 | 15996 | | |
15984 | 15997 | | |
15985 | 15998 | | |
15986 | 15999 | | |
15987 | 16000 | | |
15988 | 16001 | | |
15989 | | - | |
| 16002 | + | |
| 16003 | + | |
| 16004 | + | |
| 16005 | + | |
| 16006 | + | |
| 16007 | + | |
| 16008 | + | |
15990 | 16009 | | |
| 16010 | + | |
| 16011 | + | |
15991 | 16012 | | |
15992 | | - | |
15993 | 16013 | | |
15994 | 16014 | | |
15995 | 16015 | | |
15996 | 16016 | | |
15997 | | - | |
| 16017 | + | |
15998 | 16018 | | |
15999 | | - | |
| 16019 | + | |
16000 | 16020 | | |
16001 | 16021 | | |
16002 | 16022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
| 750 | + | |
751 | 751 | | |
| 752 | + | |
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| |||
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
763 | | - | |
| 764 | + | |
764 | 765 | | |
| 766 | + | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| |||
0 commit comments