dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.93k stars 1.86k forks source link

When using the AddPredictionEnginePool, How to Confirm the a Model is accessible if watchForChanges: true? #6920

Open BartNSTCL opened 6 months ago

BartNSTCL commented 6 months ago

System information

Windows 11, Net 8.0

When setting up a webAPI with a similar command to predictionEnginePool.AddPredictionEnginePool<InputModel, MulticlassClassificationPrediction>() .FromFile(modelName: modelName, filePath: $"MLModels/{modelName}.zip", watchForChanges: true);

Is there a way to know the model the code points to has been loaded and being currently used? I was curious if there some command in the predictionEnginePool that could be read, such as a time stamp or a way to log when the model changes. I'd liked to be able to provide feedback about the model's creation data. I can pull the timestamp from the files, but within the WebApi, I was curious about being able to monitor that part.