Commit Graph

33 Commits

Author SHA1 Message Date
Lyrcaxis f01c13ee54
Made special tokens included in prompts tokenize as intended (#677) 2024-04-20 15:23:55 +01: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
Rinne 4640c6af04 release: update release info of packages. 2024-04-06 14:20:36 +08:00
Rinne d67658a0d6
docs: update the information to v0.11.0. 2024-04-01 01:38:40 +08:00
Zoli Somogyi 91e5a3f543 Code optimization 2024-03-28 21:30:14 +01:00
Zoli Somogyi 127c3edd44 KernelMemory update with adding the use of already loaded model
When using KernelMemory one may have already loaded a model which can then be used with this extension instead of loading the model again.
2024-03-28 20:18:53 +01:00
Kenneth Tang 9e4109f774 Unable to load the model onto multiple GPUs (#617) 2024-03-20 07:03:12 +00:00
Kenneth Tang 3fda708eaa Fix System.ArgumentException: EmbeddingMode must be true 2024-03-19 06:53:16 +00:00
xbotter 3f2e5c27ff
🔧 Update package references
- Update Microsoft.KernelMemory.Core to version 0.34.240313.1
- Update Microsoft.SemanticKernel to version 1.6.2
- Update Microsoft.SemanticKernel.Plugins.Memory to version 1.6.2-alpha
- Update Microsoft.KernelMemory.Abstractions to version 0.34.240313.1
- Update Microsoft.SemanticKernel.Abstractions to version 1.6.2
2024-03-14 22:17:59 +08:00
Zoli Somogyi f578fcafa3 KernelMemory EmbeddingMode bug correction 2024-02-04 08:37:08 +01:00
Martin Evans c9c8cd0d62 - Swapped embeddings generator to use `llama_decode`
- Modified `GetEmbeddings` method to be async
2024-01-31 20:28:53 +00:00
xbotter 90815ae7d8
bump sk & km
- bump semantic kernel to 1.1.0
- bump kernel memory to 0.26
2024-01-22 19:03:28 +08:00
dependabot[bot] 89a43d8a12
build(deps): bump Microsoft.KernelMemory.Abstractions
Bumps [Microsoft.KernelMemory.Abstractions](https://github.com/microsoft/kernel-memory) from 0.18.231209.1-preview to 0.24.231228.5.
- [Release notes](https://github.com/microsoft/kernel-memory/releases)
- [Commits](https://github.com/microsoft/kernel-memory/compare/dotnet-0.18.231209.1-preview...0.24.231228.5)

---
updated-dependencies:
- dependency-name: Microsoft.KernelMemory.Abstractions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 06:14:31 +00:00
xbotter 211ce12bf5
LLamaEmbedder exposes the Context 2023-12-21 10:28:37 +08:00
xbotter ce20b30e06
Merge branch 'SciSharp:master' into deps/sk-rc3 2023-12-14 09:28:06 +08:00
xbotter 13a312b4ec
update sk to 1.0.0-rc3 & km to 0.18 2023-12-11 19:39:01 +08:00
Philipp Bauer f1eac82ecc Update target frameworks with .NET 8 2023-12-05 13:10:04 -06:00
xbotter d1e2a4750b
🔧 Update KernelMemory configuration
- Update LLamaSharpTextEmbeddingGeneration and LLamaSharpTextGeneration
- Add Microsoft.KernelMemory.Core package reference
- Update Microsoft.KernelMemory.Abstractions package reference
2023-11-24 21:42:52 +08:00
Rinne c94aeabc4b
Merge pull request #307 from xbotter/sm-default-config
Add DefaultInferenceParams to Kernel Memory
2023-11-20 10:15:28 +08:00
xbotter 286904920b
update DefaultInferenceParams in WithLLamaSharpDefaults 2023-11-18 21:40:04 +08:00
xbotter 007f501cd5
🔧 Update LlamaSharpConfig and LlamaSharpTextGeneration
- Add DefaultInferenceParams property to LlamaSharpConfig
- Update GenerateTextAsync method in LlamaSharpTextGeneration to use DefaultInferenceParams if available
- Update OptionsToParams method in LlamaSharpTextGeneration to handle defaultParams
2023-11-17 22:50:01 +08:00
xbotter 15db931a66
bump semantic kernel 1.0.0-beta8 2023-11-17 21:17:27 +08:00
xbotter 6c31f69720
bump semantic kernel to 1.0.0-beta-6 2023-11-15 15:53:06 +08:00
Yaohui Liu 460f507898
ci: update ci workflows. 2023-11-12 14:54:43 +08:00
Rinne 14b5994c93
Merge branch 'master' into add_kernel_memory_pkg 2023-11-11 03:35:44 +08:00
Yaohui Liu 46f01bbc94
feat(kernel-memory): avoid loading model twice. 2023-11-05 17:16:50 +08:00
Yaohui Liu 0f12566f65
build: use only net6.0 with kernel-memory. 2023-11-05 02:55:41 +08:00
Yaohui Liu 6a7e74e71b
build: add package for kernel-memory integration. 2023-11-04 22:38:06 +08:00
xbotter 61f47f16c8
use StatelessExecutor 2023-11-02 13:13:50 +08:00
xbotter a3a6dc3a1b
fix comments 2023-10-30 19:17:11 +08:00
xbotter 3de9d34093
update package to KernelMemory 2023-10-30 18:26:41 +08:00
xbotter a49438e6e6
🔧 Add Semantic Memory SDK to LLama.Examples
Added a project reference to LLama.KernelMemory  in the LLama.Examples.csproj file.

🔧 Add KernelMemory class and update TestRunner

Added a new class KernelMemory to the LLama.Examples.NewVersion namespace, which includes a Run method that demonstrates the usage of Semantic Kernel Memory. The class imports a sample PDF document and asks a question to the memory, displaying the answer and relevant sources.

Updated the TestRunner class in the same namespace to include an option (choice 15) to run the KernelMemory example.

🔧 Fix typo in LLamaSharpTextEmbeddingGeneration class

Fixed a typo in the LLamaSharpTextEmbeddingGeneration class where the LlamaSharpConfig variable was incorrectly named as LlamaSharpConfig.

Added XML documentation for the LLamaSharpTextEmbeddingGeneration constructor, Dispose method, and GenerateEmbeddingsAsync method.

Summary:
- Added project reference to LLama.KernelMemory and LLama.SemanticKernel in LLama.Examples.csproj
- Added KernelMemory class to demonstrate Semantic Kernel Memory usage
- Updated TestRunner class to include option for running KernelMemory example
- Fixed typo in LLamaSharpTextEmbeddingGeneration class
- Added XML documentation for constructor, Dispose method, and GenerateEmbeddingsAsync method in LLamaSharpTextEmbeddingGeneration class
2023-10-30 15:01:47 +08:00
xbotter 26cded73c6
📝 Add LLamaSharp.KernelMemory project
Add the LLamaSharp.KernelMemory project to the solution. This project includes classes for text embedding generation and text generation using the LLamaSharp library.
2023-10-30 13:21:52 +08:00