Martin Evans
4a53cdc56b
Merge pull request #142 from SciSharp/rinne-dev
refactor: remove old version files.
2 years ago
Martin Evans
33035c82bf
- Removed `LLamaNewlineTokens` from `InteractiveExecutorState`. This is always set in the constructor from the context, so there's no point serializing it.
2 years ago
Yaohui Liu
18294a725e
refactor: remove old version files.
2 years ago
Martin Evans
025741a73e
Fixed My Name
The D is for my middle name 😄
2 years ago
Yaohui Liu
20b5363601
fix: remove the history commit of embedding length property.
2 years ago
Yaohui Liu
3a847623ab
docs: update the docs to follow new version.
2 years ago
Yaohui Liu
ca6624edb3
Merge branch 'master' of github.com:SciSharp/LLamaSharp into rinne-dev
2 years ago
Rinne
4e83e48ad1
Merge pull request #122 from martindevans/gguf
Add GGUF support
2 years ago
Martin Evans
97349d93be
Merge branch 'gguf' of github.com:martindevans/LLamaSharp into gguf
2 years ago
Martin Evans
bcf06e2652
Added some comments on various native methods
2 years ago
Martin Evans
af680ac2d7
Created a hierarchy of exceptions for grammar format issues. This allows the base catch-all exception to be caught for general handling, or more specific exceptions to be caught for more specific handling.
2 years ago
Rinne
1533ee7dbf
Merge pull request #138 from drasticactions/semantic-kernel
Enable Semantic kernel support
2 years ago
Tim Miller
326c802be7
Have weights generate context
2 years ago
Tim Miller
3bca3b632e
New line
2 years ago
Tim Miller
9a1d6f99f2
Add Semantic Kernel support
2 years ago
Martin Evans
a70c7170dd
- Created a higher level `Grammar` class which is immutable and contains a list of grammar rules. This is the main "entry point" to the grammar system.
- Made all the mechanics of grammar parsing (GBNFGrammarParser, ParseState) internal. Just call `Grammar.Parse("whatever")`.
- Added a `GrammarRule` class which validates elements on construction (this allows constructing grammar without parsing GBNF).
- It should be impossible for a `GrammarRule` to represent an invalid rule.
2 years ago
SignalRT
fb007e5921
Changes to compile in VS Mac + change model to llama2
This commit includes changes to compile en VS Mac + changest to use llama2 not codellama.
It includes MacOS binaries in memory and metal
2 years ago
Mihai
24d3e1bfa8
Address PR review comment
2 years ago
Mihai
60790c5aac
Address code review comments (create custom exception, move printing to the ParseState class, rethrow error).
2 years ago
Mihai
2ae1891c13
Bug fixes after running tests.
SymbolIds is now SortedDictionary (although I'm not sure it really needs to be) because the test was failing due to expected value being in another order. The C++ data structure if SymbolIds is std::map<std::string, uint32_t> so the items are ordered by key.
2 years ago
Mihai
0bd495276b
Add initial tests + fix bugs. Still WIP since the test is failing.
2 years ago
Mihai
0f373fcc6d
Finish grammar_parser translation from C++ to C#
2 years ago
Mihai
3c919b56fe
Use ReadOnlySpan everywhere instead of ReadOnlyMemeory and instead of returning tuple, reference the ReadOnlySpan.
2 years ago
Mihai
8b4ec6d973
Address PR change requests
2 years ago
Mihai
7f31276bdf
[WIP] Translating the GrammarParser
2 years ago
Martin Evans
c9d08b943e
Added binaries for CUDA+Linux
2 years ago
Martin Evans
6711a59d0f
Included Linux deps
2 years ago
Martin Evans
ba49ea2991
Removed hardcoded paths from projects, modified Runtime.targets to exclude missing binaries
2 years ago
Martin Evans
2022b82947
Added binaries generated by this action: https://github.com/SciSharp/LLamaSharp/actions/runs/6002797872/job/16279896150
Based on this version: 6b73ef1201
2 years ago
sa_ddam213
a5d742b72c
Fix Tokenize of new line, Remove space inserts
2 years ago
Martin Evans
31287b5e6e
Rewritten TokenToSpan/TokenToString to better fit the new way it's done in llama.cpp with a few different options:
- Just convert it to a `string`, nice and simple
- Write the bytes to a `Span<byte>` no allocations
- Write the chars to a `StringBuilder` potentially no allocations
2 years ago
Martin Evans
0c98ae1955
Passing ctx to `llama_token_nl(_ctx)`
2 years ago
Martin Evans
6ffa28f964
Removed `LLAMA_MAX_DEVICES` (not used)
2 years ago
Martin Evans
2056078aef
Initial changes required for GGUF support
2 years ago
Martin Evans
826c6aaec3
cleaned up higher level code using the sampling API:
- Fixed multiple enumeration
- Fixed newline penalisation
2 years ago
Martin Evans
cf4754db44
Removed unnecessary parameters from some low level sampler methods
2 years ago
Martin Evans
f70525fec2
Two small improvements to the native sampling API:
- Modified `llama_sample_token_mirostat` and `llama_sample_token_mirostat_v2` to take `ref float` instead of as a `float*`. Less pointers is always good.
- Modified `llama_sample_repetition_penalty` and `llama_sample_frequency_and_presence_penalties` to take pointers instead of arrays. This allows the use non non allocating types (e.g. Span) instead of arrays
- Modified higher level API to accept `Memory<int>` instead of `int[]`, which can be used to reduce allocations at call sites
2 years ago
Martin Evans
a911b77dec
Various minor changes, resolving about 100 ReSharper code quality warnings
2 years ago
Martin Evans
5a6c6de0dc
Merge pull request #115 from martindevans/model_params_record
ModelsParams record class
2 years ago
Martin Evans
70be6c7368
Removed `virtual` method in newly sealed class
2 years ago
Martin Evans
ebacdb666d
- Moved the lower level state get/set methods onto SafeLLamaContextHandle
- Used those methods to add a `Clone` method to SafeLLamaContextHandle
- Simplified `LLamaContext` by using the new methods
- Sealed `LLamaContext` and `LLamaEmbedder`
2 years ago
Martin Evans
77aa5fa0d0
Added `JsonConverter` attribute, so System.Text.Json serialization is seamless
2 years ago
Martin Evans
df80ec9161
Merge pull request #97 from martindevans/embedder_tests
Embedder Test
2 years ago
Martin Evans
058c4e84b1
Rewritten LLamaEmbedder to use `LLamaContext` instead of the lower level handles
2 years ago
Martin Evans
829f32b27d
- Added `Obsolete` attributes to the entire `OldVersion` namespace, so they can be removed in the future
- Minor changes to cleanup some of the compiler warnings
2 years ago
Martin Evans
ee772a2921
added `using` statement instead of full qualification
2 years ago
Martin Evans
93f24f8a51
Switched to properly typed `Encoding` property
2 years ago
zombieguy
45b01d5a78
Improved type conversion
Type conversion is now done in the property rather than the utils class and uses the System.Convert class to ensure consistency.
2 years ago
Martin Evans
29df14cd9c
Converted ModelParams into a `record` class. This has several advantages:
- Equality, hashing etc all implemented automatically
- Default values are defined in just one place (the properties) instead of the constructor as well
- Added test to ensure that serialization works properly
2 years ago
Martin Evans
2830e5755c
- Applied a lot of minor R# code quality suggestions. Lots of unnecessary imports removed.
- Deleted `NativeInfo` (internal class, not used anywhere)
2 years ago