Skip to content

Commit

Permalink
Merge pull request #992 from stephentoub/updatemeai1245705
Browse files Browse the repository at this point in the history
Update M.E.AI to 9.0.1-preview.1.24570.5
  • Loading branch information
martindevans authored Nov 22, 2024
2 parents 21aac64 + 972e5ae commit 9aff11c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions LLama/Extensions/LLamaExecutorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ private sealed class LLamaExecutorChatClient(
public void Dispose() { }

/// <inheritdoc/>
public TService? GetService<TService>(object? key = null) where TService : class =>
typeof(TService) == typeof(ILLamaExecutor) ? (TService)_executor :
this as TService;
public object? GetService(Type serviceType, object? key = null) =>
key is not null ? null :
serviceType?.IsInstanceOfType(_executor) is true ? _executor :
serviceType?.IsInstanceOfType(this) is true ? this :
null;

/// <inheritdoc/>
public async Task<ChatCompletion> CompleteAsync(
Expand Down
8 changes: 5 additions & 3 deletions LLama/LLamaEmbedder.EmbeddingGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ public partial class LLamaEmbedder
dimensions: EmbeddingSize);

/// <inheritdoc />
TService? IEmbeddingGenerator<string, Embedding<float>>.GetService<TService>(object? key) where TService : class =>
typeof(TService) == typeof(LLamaContext) ? (TService)(object)Context :
this as TService;
object? IEmbeddingGenerator<string, Embedding<float>>.GetService(Type serviceType, object? key) =>
key is not null ? null :
serviceType?.IsInstanceOfType(Context) is true ? Context :
serviceType?.IsInstanceOfType(this) is true ? this :
null;

/// <inheritdoc />
async Task<GeneratedEmbeddings<Embedding<float>>> IEmbeddingGenerator<string, Embedding<float>>.GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options, CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion LLama/LLamaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.0-preview.9.24556.5" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.1-preview.1.24570.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="System.Numerics.Tensors" Version="9.0.0" />
</ItemGroup>
Expand Down

0 comments on commit 9aff11c

Please sign in to comment.