Skip to content

Commit

Permalink
Use AppContext.BaseDirectory instead of GetEntryAssembly
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveSandersonMS committed Mar 28, 2024
1 parent 4638417 commit 19c7686
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/SmartComponents.LocalEmbeddings/LocalEmbedder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public LocalEmbedder(string modelName = "default", bool caseSensitive = false)

private static string GetFullPathToModelFile(string modelName, string fileName)
{
var assembly = Assembly.GetEntryAssembly()!;
var baseDir = Path.GetDirectoryName(assembly.Location)!;
var baseDir = AppContext.BaseDirectory;
var fullPath = Path.Combine(baseDir, "LocalEmbeddingsModel", modelName, fileName);
if (!File.Exists(fullPath))
{
Expand Down

0 comments on commit 19c7686

Please sign in to comment.