Commit Graph

114 Commits

Author SHA1 Message Date
Martin Evans b868b056f7 Added metadata overrides to `IModelParams` 2023-12-14 02:05:40 +00:00
Martin Evans bab6b65b61 Added a safe handle for LLamaKvCacheView 2023-12-14 01:23:44 +00:00
Rinne fb75e06293
fix: output prefix of Chinese example. 2023-12-11 22:27:47 +08:00
Rinne 836f071cd0
fix: Chinese example. 2023-12-11 22:21:54 +08:00
Philipp Bauer f669a4f5a7 Update the Chinese chat sample to use new ChatSession integration 2023-12-10 09:34:11 -06:00
Philipp Bauer 2cc01efdae
Merge branch 'SciSharp:master' into master 2023-12-10 08:59:01 -06:00
Martin Evans 4fc743c9ba
Merge branch 'master' into master 2023-12-07 23:49:33 +00:00
Philipp Bauer 422605d980 Re-add ChatSession examples 2023-12-05 13:10:32 -06:00
Philipp Bauer 73d1725954 Modified / updated ChatSession examples 2023-12-05 13:10:27 -06:00
Philipp Bauer f1eac82ecc Update target frameworks with .NET 8 2023-12-05 13:10:04 -06:00
xbotter a2b26faa7a
🔧 Refactor chat completion implementation
- Refactored the chat completion implementation in `LLamaSharpChatCompletion.cs` to use `StatelessExecutor` instead of `InteractiveExecutor`.
- Updated the chat history prompt in `LLamaSharpChatCompletion.cs` to include a conversation between the assistant and the user.
- Modified the `HistoryTransform` class in `HistoryTransform.cs` to append the assistant role to the chat history prompt.
- Updated the constructor of `LLamaSharpChatCompletion` to accept optional parameters for `historyTransform` and `outputTransform`.
- Modified the `GetChatCompletionsAsync` and `GetChatCompletions` methods in `LLamaSharpChatCompletion.cs` to use the new `StatelessExecutor` and `outputTransform`.
- Updated the `ExtensionMethods.cs` file to include the assistant and system roles in the list of anti-prompts.
2023-12-01 21:39:31 +08:00
dependabot[bot] 36adc4af32
build(deps): bump Spectre.Console from 0.47.0 to 0.48.0
Bumps [Spectre.Console](https://github.com/spectreconsole/spectre.console) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/spectreconsole/spectre.console/releases)
- [Commits](https://github.com/spectreconsole/spectre.console/compare/0.47.0...0.48.0)

---
updated-dependencies:
- dependency-name: Spectre.Console
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 06:17:53 +00:00
Rinne 605d1ddb3f
revert a change. 2023-11-25 02:06:25 +08:00
Rinne 934358a7b3
Merge branch 'master' of github.com:AsakusaRinne/LLamaSharp into fix_chinese 2023-11-25 01:53:27 +08:00
Rinne 217c67b757
fix: chinese encoding error. 2023-11-25 01:44:29 +08: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
dependabot[bot] 20a0dc7ac6
build(deps): bump Microsoft.Extensions.Logging.Console
Bumps [Microsoft.Extensions.Logging.Console](https://github.com/dotnet/runtime) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/compare/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Logging.Console
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 06:49:32 +00: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 1056e13414
fix examples 2023-11-17 22:21:43 +08:00
xbotter 15db931a66
bump semantic kernel 1.0.0-beta8 2023-11-17 21:17:27 +08:00
Martin Evans 9905baa7c4
Merge pull request #300 from martindevans/minor_demos_cleanup
Minor cleanup on example code
2023-11-17 01:38:54 +00:00
Martin Evans 1dd4c6ab7a
Merge pull request #296 from xbotter/deps/sk_1.0.0-beta6
bump semantic kernel to 1.0.0-beta-6
2023-11-17 01:28:50 +00:00
Martin Evans 479779e908 Some minor cleanup on example code:
- Removed special case for exit
 - Added a wait at the end of batched decoding
2023-11-17 01:28:05 +00:00
xbotter 6c31f69720
bump semantic kernel to 1.0.0-beta-6 2023-11-15 15:53:06 +08:00
xbotter 521e36903c
🔀 Remove unused code and update examples
- Renamed files and updated namespaces in Examples folder.
- Moved files from NewVersion folder to Examples folder.
- Removed TestRunner.cs file.
- Updated Runner.cs to include new examples.
- Update Program.cs to use the new Runner class instead of NewVersionTestRunner
- Update LLama.Examples namespace in Program.cs
- Update await NewVersionTestRunner.Run() in Program.cs to await Runner.Run()
2023-11-15 15:37:22 +08:00
Martin Evans a9d1f6cb47 - Renamed `NativeLibraryConfig.Default` to `NativeLibraryConfig.Instance`. It's not default any more as soon as you call `WithX`!
- using `Lazy<T>` to initialize it automatically.
 - Added in `AVX512` support for all dotnet versions (but not autodetected).
 - Added in AVX version auto detection.
2023-11-13 02:05:07 +00:00
Yaohui Liu d7675f7936
Merge branch 'master' of github.com:AsakusaRinne/LLamaSharp into cuda_detection 2023-11-12 12:10:31 +08:00
Yaohui Liu cb5fb210b1
feat: optimize apis for cuda feature detection. 2023-11-12 04:30:08 +08:00
SignalRT fb95bbb4e0 Merge remote-tracking branch 'upstream/master' into RuntimeDetection 2023-11-11 09:09:03 +01:00
SignalRT 6de8d6219a Change SemanticKernel version to beta1 on Examples 2023-11-11 09:05:17 +01:00
Rinne 14b5994c93
Merge branch 'master' into add_kernel_memory_pkg 2023-11-11 03:35:44 +08:00
SignalRT 5fe721bdbe Revert "Merge branch 'pr/268' into RuntimeDetection"
This reverts commit 091b8d58b3, reversing
changes made to 9b2ca9cf8e.
2023-11-09 22:13:18 +01:00
xbotter f9087015d6
🔀 Refactor TestRunner.cs
- Handle invalid choice in Examples.TryGetValue
- Add exit condition for choice "Exit"
- Display a rule before executing example
- Clear console after each iteration

📝 This change refactors the TestRunner.cs file. It handles invalid choices in Examples.TryGetValue, adds an exit condition for the choice "Exit", displays a rule before executing an example, and clears the console after each iteration.
2023-11-06 22:04:44 +08:00
Yaohui Liu 457958435b
build: use semantic-kernel beta1 in examples. 2023-11-05 02:59:41 +08:00
Martin Evans 3a4a91bc08
Merge pull request #231 from SciSharp/dependabot/nuget/Microsoft.SemanticKernel-1.0.0-beta4
build(deps): bump Microsoft.SemanticKernel from 1.0.0-beta1 to 1.0.0-beta4
2023-11-04 18:46:46 +00:00
dependabot[bot] 25d6b3ce50
build(deps): bump Microsoft.SemanticKernel
Bumps [Microsoft.SemanticKernel](https://github.com/microsoft/semantic-kernel) from 1.0.0-beta1 to 1.0.0-beta4.
- [Release notes](https://github.com/microsoft/semantic-kernel/releases)
- [Commits](https://github.com/microsoft/semantic-kernel/compare/dotnet-1.0.0-beta1...dotnet-1.0.0-beta4)

---
updated-dependencies:
- dependency-name: Microsoft.SemanticKernel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-03 10:48:38 +00:00
xbotter c52e99ac77
update example 2023-11-02 14:03:17 +08:00
xbotter 8c425b9e57
Merge branch 'master' into kernel-memory 2023-11-01 09:03:37 +08:00
xbotter e36a118360
fix name 2023-10-30 19:11:27 +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
Martin Evans 7e3cde4c13 Moved helper methods into `LLamaBatchSafeHandle` 2023-10-28 22:09:09 +01:00
Martin Evans aae63a5b92 Minor cleanup on the BatchedDecoding example 2023-10-28 21:32:22 +01:00
Martin Evans f41d26fe32 Removed hardcoded model path 2023-10-28 21:32:22 +01:00
Martin Evans e81b3023d5 Rewritten sampling API to be accessed through the `LLamaTokenDataArray` object 2023-10-28 21:32:21 +01:00
Martin Evans 3c5547b2b7 Reduced some uses of `NativeApi` in `BatchedDecoding` by adding some helper methods 2023-10-28 21:32:21 +01:00
Martin Evans a024d2242e It works!
had to update binary to `b1426`
2023-10-28 21:32:21 +01:00
Martin Evans 8cd81251b4 initial setup 2023-10-28 21:32:21 +01:00
xbotter ab83016fb4
chore: update semantic kernel examples 2023-10-20 10:24:40 +08:00