Skip to content

Commit

Permalink
Merge pull request #89 from martindevans/fix_use_mmap
Browse files Browse the repository at this point in the history
Fixed `ToLlamaContextParams` using the wrong parameter for `use_mmap`
  • Loading branch information
martindevans authored Aug 7, 2023
2 parents bab3b46 + 91bcefc commit f612275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion LLama/Extensions/IModelParamsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace LLama.Extensions
{
/// <summary>
/// Extention methods to the IModelParams interface
/// </summary>
public static class IModelParamsExtensions
{
/// <summary>
Expand All @@ -31,7 +34,7 @@ public static MemoryHandle ToLlamaContextParams(this IModelParams @params, out L
result.n_gpu_layers = @params.GpuLayerCount;
result.seed = @params.Seed;
result.f16_kv = @params.UseFp16Memory;
result.use_mmap = @params.UseMemoryLock;
result.use_mmap = @params.UseMemorymap;
result.use_mlock = @params.UseMemoryLock;
result.logits_all = @params.Perplexity;
result.embedding = @params.EmbeddingMode;
Expand Down
3 changes: 0 additions & 3 deletions LLama/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
using LLama.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using LLama.Exceptions;
using LLama.Extensions;

namespace LLama
Expand Down

0 comments on commit f612275

Please sign in to comment.