Commit Graph

1290 Commits

Author SHA1 Message Date
Rinne 495177fd0f fix: typos. 2024-04-29 18:19:20 +08:00
Rinne de31a06a4a ci: add workflow to check the spelling. 2024-04-29 18:07:13 +08:00
Rinne 98909dc2af
Merge pull request #708 from AsakusaRinne/llama3_support
Add LLaMA3 chat session example.
2024-04-29 10:36:19 +08:00
Martin Evans 4c078a757c
Merge pull request #703 from martindevans/llava_async_load
LLava Async Loading
2024-04-28 22:38:21 +01:00
Rinne 175b25d4f7
Add LLaMA3 chat session example. 2024-04-29 04:12:19 +08:00
Martin Evans 377ebf3664 - Added `LoadFromFileAsync` method for `LLavaWeights`
- Fixed checking for invalid handles in `clip_model_load`
2024-04-27 23:31:07 +01:00
Martin Evans 84bb5a36ab
Merge pull request #702 from martindevans/interruptible_async_model_load
Interruptible Async Model Loading With Progress Monitoring
2024-04-27 16:06:40 +01:00
Martin Evans 1ec0fee5ba Added optional `IProgress` parameter to `LoadFromFileAsync` 2024-04-27 15:04:54 +01:00
Martin Evans 9867b4c85d Only setting callback if the token can be cancelled. 2024-04-27 02:55:35 +01:00
Martin Evans 00df7c1516 - Added `LLamaWeights.LoadFromFileAsync`.
- Async loading supports cancellation through a `CancellationToken`. If loading is cancelled an `OperationCanceledException` is thrown.  If it fails for another reason a `LoadWeightsFailedException` is thrown.
 - Updated examples to use `LoadFromFileAsync`
2024-04-27 02:52:41 +01:00
Rinne b47ed9258f
Merge pull request #701 from AsakusaRinne/add_issue_template
Fix typo in issue templates.
2024-04-27 03:59:27 +08:00
Rinne bcf3ef1e40
Fix typo in issue templates. 2024-04-27 03:58:45 +08:00
Rinne c6565c3aaf
Merge pull request #700 from AsakusaRinne/add_issue_template
Add issue templates.
2024-04-27 03:56:58 +08:00
Rinne d56eb1a5ad
Add issue templates. 2024-04-27 03:38:20 +08:00
Martin Evans 18586cc43b
Merge pull request #696 from martindevans/safe_handle_constructor_refactor
Removed Unnecessary Constructor From Safe Handles
2024-04-26 16:14:42 +01:00
Martin Evans e9fd7f96e0
Merge pull request #691 from martindevans/empty_batch_check
Empty batch check
2024-04-26 16:14:28 +01:00
Martin Evans a2f8573831
Merge pull request #698 from martindevans/slightly_safer_quantize_params
Slightly Safer Quantize Params
2024-04-26 13:53:55 +01:00
Martin Evans d4f793a7eb Using `is` check instead of `== null` 2024-04-26 13:53:04 +01:00
Martin Evans ecb359c9e7
- Using more specific `LoadWeightsFailedException` when a llava model fails to load (#697)
- Passing model path, instead of a message, to `LoadWeightsFailedException` constructor
2024-04-26 13:39:09 +01:00
Martin Evans 58ec798bff Modified `llama_model_quantize` to accept argument by `ref` instead of pointer. 2024-04-26 01:35:13 +01:00
Martin Evans 54dab273cd - Removed unnecessary constructors from safe handles
- Returning SafeLLamaGrammarHandle directly from `llama_grammar_init` and `llama_grammar_copy`
2024-04-26 01:03:26 +01:00
Martin Evans 25812762c9 Added checks in `Decode` to skip doing anything if the batch is empty. 2024-04-24 14:54:02 +01:00
Martin Evans ccc49eb1e0
BatchedExecutor Save/Load (#681)
* Added the ability to save and load individual conversations in a batched executor.
 - New example
 - Added `BatchedExecutor.Load(filepath)` method
 - Added `Conversation.Save(filepath)` method
 - Added new (currently internal) `SaveState`/`LoadState` methods in LLamaContext which can stash some extra binary data in the header

* Added ability to save/load a `Conversation` to an in-memory state, instead of to file.

* Moved the new save/load methods out to an extension class specifically for the batched executor.

* Removed unnecessary spaces
2024-04-23 15:46:56 +01:00
Lyrcaxis f01c13ee54
Made special tokens included in prompts tokenize as intended (#677) 2024-04-20 15:23:55 +01:00
jlsantiago ebc7c24ef7
Merge pull request #678 from SignalRT/master
Disable Metal on CI UnitTest
2024-04-19 19:41:28 +02:00
SignalRT b416966ec4 Disable Metal on CI UnitTest 2024-04-19 19:38:58 +02:00
Martin Evans 550f2f7684 Fixed build due to changes in unit tests 2024-04-19 18:31:14 +01:00
jlsantiago 8f358e12e3
Merge pull request #672 from SignalRT/master
Reintroduce MacOS on CI
2024-04-19 19:17:23 +02:00
jlsantiago df9a549e64
Merge branch 'master' into master 2024-04-19 19:17:09 +02:00
Martin Evans 3c76440957 - Added tests for generating embeddings with generative model and embedding model
- Rewritten native API methods for embeddings to return pointers - null is a valid value for these methods to return so `Span` is not appropriate
2024-04-19 16:30:32 +01:00
Zoli Somogyi 89217f73ca
Embeddings correction (#674)
* Embeddings correction
2024-04-19 16:23:44 +01:00
SignalRT 49f437f3ec Typo on comment. Disable Metal on MacOS / OSX 2024-04-19 06:52:58 +02:00
SignalRT 53ae904875 Set GPULayerCount to execute the Test
Set GPULayerCount to default value (20) to execute UnitTest. In the case of Release Execution on MacOS set the value to ZERO to disable METAL on MacOS and be able to execute it in CI.
2024-04-18 22:03:47 +02:00
SignalRT e6b7141188 Change attribute to a Filter to disable test on CI 2024-04-18 21:29:37 +02:00
SignalRT 75cad1f3a5 Remove .NET7 on test 2024-04-18 06:36:09 +02:00
SignalRT 89fbbc0f51 Restore previous dotnet-versions 2024-04-18 06:13:10 +02:00
SignalRT bb5d7e189d Create an Specific Fact attribute to disable some test on CI and execute that test on Debug 2024-04-17 23:03:31 +02:00
SignalRT cbe0c0ef3e Disable metal 2024-04-17 22:37:08 +02:00
SignalRT 74bde89a61 Test to disable metal on test 2024-04-17 22:24:29 +02:00
SignalRT 330e38553e .NET 6 2024-04-17 22:11:52 +02:00
SignalRT 44c393db1e Reintroduce MacOS on test builds
Using the new M1 macos runner:

https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
2024-04-17 21:44:30 +02:00
Martin Evans c325ac9127
April 2024 Binary Update (#662)
* Updated binaries, using [this build](https://github.com/SciSharp/LLamaSharp/actions/runs/8654672719/job/23733195669) for llama.cpp commit `f7001ccc5aa359fcf41bba19d1c99c3d25c9bcc7`.

 - Added all new functions.
 - Moved some functions (e.g. `SafeLlamaModelHandle` specific functions) into `SafeLlamaModelHandle.cs`
 - Exposed tokens on `SafeLlamaModelHandle` and `LLamaWeights` through a `Tokens` property. As new special tokens are added in the future they can be added here.
 - Changed all token properties to return nullable tokens, to handle some models not having some tokens.
 - Fixed `DefaultSamplingPipeline` to handle no newline token in some models.

* Moved native methods to more specific locations.

 - Context specific things have been moved into `SafeLLamaContextHandle.cs` and made private - they're exposed through C# properties and methods already.
 - Checking that GPU layer count is zero if GPU offload is not supported.
 - Moved methods for creating default structs (`llama_model_quantize_default_params` and `llama_context_default_params`) into relevant structs.

* Removed exception if `GpuLayerCount > 0` when GPU is not supported.

* - Added low level wrapper methods for new per-sequence state load/save in `SafeLLamaContextHandle`
 - Added high level wrapper methods (save/load with `State` object or memory mapped file) in `LLamaContext`
 - Moved native methods for per-sequence state load/save into `SafeLLamaContextHandle`

* Added update and defrag methods for KV cache in `SafeLLamaContextHandle`

* Updated submodule to `f7001ccc5aa359fcf41bba19d1c99c3d25c9bcc7`

* Passing the sequence ID when saving a single sequence state
2024-04-16 23:19:47 +01:00
jlsantiago 399e81d314
Merge pull request #664 from SignalRT/LLavaResetOnImageChange
Llava Initial approach to clear images
2024-04-16 21:37:06 +02:00
Martin Evans 274ab6e578
Merge pull request #663 from martindevans/remove_example_context_size
Removed `ContextSize` from most examples
2024-04-15 14:24:54 +01:00
Martin Evans 6b816dd51b Removed context size from SpeechChat 2024-04-15 13:49:47 +01:00
Martin Evans 18d784e088
Merge pull request #665 from martindevans/fix_beam_test
Fixed Beam Search Test
2024-04-14 15:52:12 +01:00
Martin Evans 80d9c9b218
Merge pull request #667 from martindevans/disable_macos_ci_2
Removed MacOS CI
2024-04-14 15:52:01 +01:00
Martin Evans 25379df93b Removed it from `build` list too 2024-04-14 15:41:00 +01:00
Martin Evans 7899c73051 Fixed formatting 2024-04-14 15:38:53 +01:00
Martin Evans 6f4958e044
Merge pull request #666 from martindevans/disabled_MacOS_CI
Disable MacOS CI
2024-04-14 15:37:11 +01:00