Closed euju-ms closed 1 month ago
@dotnet-policy-service agree company="Microsoft"
@eiriktsarpalis could you please have a quick look at this change. The change is just changing the json deserialization code to use the source generator.
Attention: Patch coverage is 85.71429%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 68.81%. Comparing base (
823fc17
) to head (5483e4f
). Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
...rosoft.ML.Tokenizers/Utils/StringSpanOrdinalKey.cs | 50.00% | 1 Missing :warning: |
Thanks for the review :)
/ba-g unrelated infrastructure failure.
Fixes https://github.com/dotnet/machinelearning/issues/7271
This PR makes ML.Tokenizers project AOT compatible.
ML.Tokenizers is made to use SourceGenerationContext for deserializing Json.
I had to create a helper class
Vocabulary
in order to register aJsonConverter
for it.Before the change, we have following Aot warnings on the calls to Json.Deserialize:
After the change, warnings are no more :)
Note that
netstandard2.0
framework is not Aot compatible as trimming is only supported for .NET 6 and later. Therefore, in order to test the compatibility for Microsoft.ML.Tokenizers project, you need to set the TargetFramework to net8.0.Then you can add
<PublishAot>true</PublishAot>
.e.g. Microsoft.ML.Tokenizers.csproj
Then building specifically for
Microsoft.ML.Tokenizers
should result in warnings if the project is not AOT compatible.We are excited to review your PR.
So we can do the best job, please check:
Fixes #nnnn
in your description to cause GitHub to automatically close the issue(s) when your PR is merged.