Browse Source

Merge pull request #149 from martindevans/removed_unused_inference_params

Removed unused properties of `InferenceParams` & `ModelParams`
tags/v0.6.0
Martin Evans GitHub 2 years ago
parent
commit
b1e9d8240d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 49 deletions
  1. +0
    -15
      LLama/Abstractions/IInferenceParams.cs
  2. +0
    -10
      LLama/Abstractions/IModelParams.cs
  3. +1
    -12
      LLama/Common/InferenceParams.cs
  4. +1
    -12
      LLama/Common/ModelParams.cs

+ 0
- 15
LLama/Abstractions/IInferenceParams.cs View File

@@ -31,21 +31,6 @@ namespace LLama.Abstractions
/// </summary>
public IEnumerable<string> AntiPrompts { get; set; }

/// <summary>
/// path to file for saving/loading model eval state
/// </summary>
public string PathSession { get; set; }

/// <summary>
/// string to suffix user inputs with
/// </summary>
public string InputSuffix { get; set; }

/// <summary>
/// string to prefix user inputs with
/// </summary>
public string InputPrefix { get; set; }

/// <summary>
/// 0 or lower to use vocab size
/// </summary>


+ 0
- 10
LLama/Abstractions/IModelParams.cs View File

@@ -57,11 +57,6 @@ namespace LLama.Abstractions
/// </summary>
string ModelPath { get; set; }

/// <summary>
/// model alias
/// </summary>
string ModelAlias { get; set; }

/// <summary>
/// lora adapter path (lora_adapter)
/// </summary>
@@ -82,11 +77,6 @@ namespace LLama.Abstractions
/// </summary>
int BatchSize { get; set; }

/// <summary>
/// Whether to convert eos to newline during the inference.
/// </summary>
bool ConvertEosToNewLine { get; set; }

/// <summary>
/// Whether to use embedding mode. (embedding) Note that if this is set to true,
/// The LLamaModel won't produce text response anymore.


+ 1
- 12
LLama/Common/InferenceParams.cs View File

@@ -29,18 +29,7 @@ namespace LLama.Common
/// Sequences where the model will stop generating further tokens.
/// </summary>
public IEnumerable<string> AntiPrompts { get; set; } = Array.Empty<string>();
/// <summary>
/// path to file for saving/loading model eval state
/// </summary>
public string PathSession { get; set; } = string.Empty;
/// <summary>
/// string to suffix user inputs with
/// </summary>
public string InputSuffix { get; set; } = string.Empty;
/// <summary>
/// string to prefix user inputs with
/// </summary>
public string InputPrefix { get; set; } = string.Empty;

/// <summary>
/// 0 or lower to use vocab size
/// </summary>


+ 1
- 12
LLama/Common/ModelParams.cs View File

@@ -53,10 +53,6 @@ namespace LLama.Common
/// </summary>
public string ModelPath { get; set; }
/// <summary>
/// model alias
/// </summary>
public string ModelAlias { get; set; } = "unknown";
/// <summary>
/// lora adapter path (lora_adapter)
/// </summary>
public string LoraAdapter { get; set; } = string.Empty;
@@ -73,11 +69,6 @@ namespace LLama.Common
/// </summary>
public int BatchSize { get; set; } = 512;

/// <summary>
/// Whether to convert eos to newline during the inference.
/// </summary>
public bool ConvertEosToNewLine { get; set; } = false;

/// <summary>
/// Whether to use embedding mode. (embedding) Note that if this is set to true,
/// The LLamaModel won't produce text response anymore.
@@ -141,7 +132,6 @@ namespace LLama.Common
/// <param name="loraBase">Base model path for the lora adapter (lora_base)</param>
/// <param name="threads">Number of threads (-1 = autodetect) (n_threads)</param>
/// <param name="batchSize">Batch size for prompt processing (must be >=32 to use BLAS) (n_batch)</param>
/// <param name="convertEosToNewLine">Whether to convert eos to newline during the inference.</param>
/// <param name="embeddingMode">Whether to use embedding mode. (embedding) Note that if this is set to true, The LLamaModel won't produce text response anymore.</param>
/// <param name="ropeFrequencyBase">RoPE base frequency.</param>
/// <param name="ropeFrequencyScale">RoPE frequency scaling factor</param>
@@ -152,7 +142,7 @@ namespace LLama.Common
int seed = 1337, bool useFp16Memory = true,
bool useMemorymap = true, bool useMemoryLock = false, bool perplexity = false,
string loraAdapter = "", string loraBase = "", int threads = -1, int batchSize = 512,
bool convertEosToNewLine = false, bool embeddingMode = false,
bool embeddingMode = false,
float ropeFrequencyBase = 10000.0f, float ropeFrequencyScale = 1f, bool mulMatQ = false,
string encoding = "UTF-8")
{
@@ -168,7 +158,6 @@ namespace LLama.Common
LoraBase = loraBase;
Threads = threads == -1 ? Math.Max(Environment.ProcessorCount / 2, 1) : threads;
BatchSize = batchSize;
ConvertEosToNewLine = convertEosToNewLine;
EmbeddingMode = embeddingMode;
RopeFrequencyBase = ropeFrequencyBase;
RopeFrequencyScale = ropeFrequencyScale;


Loading…
Cancel
Save