diff --git a/LLama.Benchmark/Constants.cs b/LLama.Benchmark/Constants.cs index 76dbb62e..f64908d8 100644 --- a/LLama.Benchmark/Constants.cs +++ b/LLama.Benchmark/Constants.cs @@ -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"; } } diff --git a/LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs b/LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs index aeb107ed..fb087962 100644 --- a/LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs +++ b/LLama.Benchmark/LLamaExecutorBenchmark/Prefill.cs @@ -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