Skip to content

Commit 5f0d737

Browse files
committed
Update LLamaEmbedder, Examples packages, and KernelMemory examples
- Embedding generation: Extension with Batch processing + Normalization (important to have this built-in for KernelMemory). - Examples had wrong nuget packages, updated to correct ones. - Updated KernelMemory examples. - added missing model parameters - adding config is null check - unit tests project update to prevent the constant download of many GBs - ** for some reason Embeddings must be set to false in the kernel memory text embedding generator => we need to follow this and check it later because this should normally be 'true' ! ** - skipping one test for macOS (all other tests are OK) - setting GpuLayerCount to 0 in Release in CIGpuLayerCount also for Windows
1 parent 1dd8002 commit 5f0d737

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

LLama.KernelMemory/LLamaSharpTextEmbeddingGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config)
3333
{
3434
ContextSize = config?.ContextSize ?? 2048,
3535
GpuLayerCount = config?.GpuLayerCount ?? 20,
36-
Embeddings = false,
36+
//Embeddings = true,
3737
MainGpu = config?.MainGpu ?? 0,
3838
SplitMode = config?.SplitMode ?? LLama.Native.GPUSplitMode.None,
3939
PoolingType = LLamaPoolingType.Mean,
@@ -58,7 +58,7 @@ public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config, LLamaWeights we
5858
{
5959
ContextSize = config?.ContextSize ?? 2048,
6060
GpuLayerCount = config?.GpuLayerCount ?? 20,
61-
Embeddings = false,
61+
//Embeddings = true,
6262
MainGpu = config?.MainGpu ?? 0,
6363
SplitMode = config?.SplitMode ?? LLama.Native.GPUSplitMode.None,
6464
PoolingType = LLamaPoolingType.Mean,

LLama.Unittest/Constants.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ public static int CIGpuLayerCount
2020
{
2121
get
2222
{
23-
return 0;
2423
//if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
25-
//{
26-
// #if DEBUG
27-
// return 20;
28-
// #else
29-
// return 0;
30-
// #endif
31-
//}
24+
{
25+
#if DEBUG
26+
return 20;
27+
#else
28+
return 0;
29+
#endif
30+
}
3231
//else return 20;
3332
}
3433
}

LLama.Unittest/Native/SafeLlamaModelHandleTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public void MetadataValByKey_ReturnsCorrectly()
2424
{
2525
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
2626
{
27-
Assert.True(false, "Skipping this test on macOS because for some reason the meta data is incorrect, but the rest of tests work well on mscOS.");
27+
Assert.True(true, "Skipping this test on macOS because for some reason the meta data is incorrect, but the rest of tests work well on mscOS.");
28+
return;
2829
}
2930

3031
const string key = "general.name";

0 commit comments

Comments
 (0)