diff --git a/LLama.Web/Pages/Shared/_Parameters.cshtml b/LLama.Web/Pages/Shared/_Parameters.cshtml
index d6e476c4..76f3e321 100644
--- a/LLama.Web/Pages/Shared/_Parameters.cshtml
+++ b/LLama.Web/Pages/Shared/_Parameters.cshtml
@@ -1,7 +1,6 @@
@page
@using LLama.Common;
@model LLama.Abstractions.IInferenceParams
-}
diff --git a/LLama.Web/Program.cs b/LLama.Web/Program.cs
index 7c4583d2..193090d0 100644
--- a/LLama.Web/Program.cs
+++ b/LLama.Web/Program.cs
@@ -14,6 +14,8 @@ namespace LLama.Web
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddSignalR();
+ builder.Logging.ClearProviders();
+ builder.Services.AddLogging((loggingBuilder) => loggingBuilder.SetMinimumLevel(LogLevel.Trace).AddConsole());
// Load InteractiveOptions
builder.Services.AddOptions
()
diff --git a/LLama.Web/Services/ModelService.cs b/LLama.Web/Services/ModelService.cs
index dfb34bb6..3634f6ab 100644
--- a/LLama.Web/Services/ModelService.cs
+++ b/LLama.Web/Services/ModelService.cs
@@ -1,6 +1,7 @@
using LLama.Web.Async;
using LLama.Web.Common;
using LLama.Web.Models;
+using Microsoft.Extensions.Options;
using System.Collections.Concurrent;
namespace LLama.Web.Services
@@ -11,10 +12,10 @@ namespace LLama.Web.Services
///
public class ModelService : IModelService
{
- private readonly ILogger _llamaLogger;
private readonly AsyncLock _modelLock;
private readonly AsyncLock _contextLock;
private readonly LLamaOptions _configuration;
+ private readonly ILogger _llamaLogger;
private readonly ConcurrentDictionary _modelInstances;
@@ -23,12 +24,12 @@ namespace LLama.Web.Services
///
/// The logger.
/// The options.
- public ModelService(LLamaOptions configuration, ILogger llamaLogger)
+ public ModelService(IOptions configuration, ILogger llamaLogger)
{
_llamaLogger = llamaLogger;
_modelLock = new AsyncLock();
_contextLock = new AsyncLock();
- _configuration = configuration;
+ _configuration = configuration.Value;
_modelInstances = new ConcurrentDictionary();
}
diff --git a/LLama.Web/appsettings.json b/LLama.Web/appsettings.json
index 6231b882..82d62b1a 100644
--- a/LLama.Web/appsettings.json
+++ b/LLama.Web/appsettings.json
@@ -7,12 +7,12 @@
},
"AllowedHosts": "*",
"LLamaOptions": {
- "ModelLoadType": "Single",
+ "ModelLoadType": 0,
"Models": [
{
- "Name": "WizardLM-7B",
+ "Name": "LLama2-7b-Chat",
"MaxInstances": 20,
- "ModelPath": "D:\\Repositories\\AI\\Models\\wizardLM-7B.ggmlv3.q4_0.bin",
+ "ModelPath": "..\\LLama.Unittest\\Models\\llama-2-7b-chat.Q4_0.gguf",
"ContextSize": 2048,
"BatchSize": 2048,
"Threads": 4,
diff --git a/LLama.Web/wwwroot/js/sessionConnectionChat.js b/LLama.Web/wwwroot/js/sessionConnectionChat.js
index 719c44ac..24821150 100644
--- a/LLama.Web/wwwroot/js/sessionConnectionChat.js
+++ b/LLama.Web/wwwroot/js/sessionConnectionChat.js
@@ -43,8 +43,8 @@ const createConnectionSessionChat = () => {
return;
if (response.tokenType == Enums.TokenType.Begin) {
- const uniqueId = randomString();
- outputContainer.append(Mustache.render(outputBotTemplate, { id: uniqueId, ...response }));
+ let uniqueId = randomString();
+ outputContainer.append(Mustache.render(outputBotTemplate, { uniqueId: uniqueId, ...response }));
responseContainer = $(`#${uniqueId}`);
responseContent = responseContainer.find(".content");
responseFirstToken = true;
@@ -102,6 +102,7 @@ const createConnectionSessionChat = () => {
}
const unloadModel = async () => {
+ await cancelPrompt();
disableControls();
enablePromptControls();
$("#load").removeAttr("disabled");