diff --git a/LLama.Web/Models/ModelSession.cs b/LLama.Web/Models/ModelSession.cs index 3f58f05c..8eeea3f6 100644 --- a/LLama.Web/Models/ModelSession.cs +++ b/LLama.Web/Models/ModelSession.cs @@ -13,9 +13,8 @@ namespace LLama.Web.Models private ILLamaExecutor _executor; private CancellationTokenSource _cancellationTokenSource; - public ModelSession(string connectionId, ILLamaExecutor executor, ModelOptions modelOptions, PromptOptions promptOptions, ParameterOptions parameterOptions) + public ModelSession(ILLamaExecutor executor, ModelOptions modelOptions, PromptOptions promptOptions, ParameterOptions parameterOptions) { - ConnectionId = connectionId; _executor = executor; _modelOptions = modelOptions; _promptOptions = promptOptions; @@ -26,8 +25,6 @@ namespace LLama.Web.Models _outputTransform = new LLamaTransforms.KeywordTextOutputStreamTransform(_promptOptions.OutputFilter, redundancyLength: 5); } - public string ConnectionId { get; } - public IAsyncEnumerable InferAsync(string message, CancellationTokenSource cancellationTokenSource) { _cancellationTokenSource = cancellationTokenSource; diff --git a/LLama.Web/Pages/Interactive.cshtml b/LLama.Web/Pages/Interactive.cshtml index 001373ee..5224839a 100644 --- a/LLama.Web/Pages/Interactive.cshtml +++ b/LLama.Web/Pages/Interactive.cshtml @@ -172,8 +172,8 @@ const chatInput = $("#input"); - const onStatus = (connectionId, status) => { - connectionId = connectionId; + const onStatus = (connection, status) => { + connectionId = connection; if (status == Enums.SessionConnectionStatus.Connected) { $("#socket").text("Connected").addClass("text-success"); } diff --git a/LLama.Web/Services/ModelSessionService.cs b/LLama.Web/Services/ModelSessionService.cs index ed3a9903..51b47f6e 100644 --- a/LLama.Web/Services/ModelSessionService.cs +++ b/LLama.Web/Services/ModelSessionService.cs @@ -25,7 +25,7 @@ namespace LLama.Web.Services public Task CreateAsync(string connectionId, ILLamaExecutor executor, ModelOptions modelOption, PromptOptions promptOption, ParameterOptions parameterOption) { //TODO: Max instance etc - var modelSession = new ModelSession( connectionId, executor, modelOption, promptOption, parameterOption); + var modelSession = new ModelSession(executor, modelOption, promptOption, parameterOption); if (!_modelSessions.TryAdd(connectionId, modelSession)) { _logger.Log(LogLevel.Error, "[CreateAsync] - Failed to create model session, Connection: {0}", connectionId);