Browse Source

fix model path error.

pull/720/head
Rinne 2 years ago
parent
commit
f336a43886
2 changed files with 8 additions and 9 deletions
  1. +6
    -6
      LLama.Benchmark/Constants.cs
  2. +2
    -3
      LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs

+ 6
- 6
LLama.Benchmark/Constants.cs View File

@@ -11,13 +11,13 @@ namespace LLama.Benchmark
{
public static string ModelDir { get; set; } = "";

public static string Generative7BModelPath => Path.Combine(ModelDir, "llama-2-7b-chat.Q3_K_S.gguf");
public static string EmbeddingModelPath => Path.Combine(ModelDir, "all-MiniLM-L12-v2.Q8_0.gguf");
public readonly static string Generative7BModelPath = "llama-2-7b-chat.Q3_K_S.gguf";
public readonly static string EmbeddingModelPath = "all-MiniLM-L12-v2.Q8_0.gguf";

public static string LLavaModelPath => Path.Combine(ModelDir, "llava-v1.6-mistral-7b.Q3_K_XS.gguf");
public static string LLavaMmpPath => Path.Combine(ModelDir, "mmproj-model-f16.gguf");
public static string LLavaImage => "Assets/extreme-ironing-taxi-610x427.jpg";
public readonly static string LLavaModelPath = "llava-v1.6-mistral-7b.Q3_K_XS.gguf";
public readonly static string LLavaMmpPath = "mmproj-model-f16.gguf";
public readonly static string LLavaImage = "Assets/extreme-ironing-taxi-610x427.jpg";

public static string TextCompletionPromptsFilePath = "Assets/TextCompletionPrompts.txt";
public readonly static string TextCompletionPromptsFilePath = "Assets/TextCompletionPrompts.txt";
}
}

+ 2
- 3
LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs View File

@@ -76,7 +76,7 @@ namespace LLama.Benchmark.LLamaExecutorBenchmark

private void InitializeParamsAndModel()
{
ModelParams = new ModelParams(ModelAndGpuLayerCount.Item1)
ModelParams = new ModelParams(Path.Combine(Constants.ModelDir, ModelAndGpuLayerCount.Item1))
{
ContextSize = PromptAndContextLength.Item2,
GpuLayerCount = ModelAndGpuLayerCount.Item2
@@ -87,8 +87,7 @@ namespace LLama.Benchmark.LLamaExecutorBenchmark
Temperature = 0.6f,
MaxTokens = 1 // Only prefill, no generation here.
};

Console.WriteLine($"************ model params model path: {ModelParams.ModelPath} specified path: {ModelAndGpuLayerCount.Item1}");
LLamaWeights weights = LLamaWeights.LoadFromFile(ModelParams);
LLamaContext context = weights.CreateContext(ModelParams);
Executor = ExecutorType switch


Loading…
Cancel
Save