dotnet-smartcomponents / smartcomponents

Experimental, end-to-end AI features for .NET apps
622 stars 54 forks source link

Specify model at runtime #54

Closed Giorgi closed 2 weeks ago

Giorgi commented 1 month ago

When using LocalEmbedder is it possible to specify the model to use at runtime (via ctor) instead of setting it in the csproj file? It can be useful when we want to experiment with different models and compare them.

SteveSandersonMS commented 2 weeks ago

Yes, the LocalEmbedder constructor already takes an optional modelName parameter.

You just need to make sure that you've already downloaded the model at build time (or to download it using your own logic at runtime before calling new LocalEmbedder(modelName)).