Currently, the predict_spectra() function loads an existing model from an .Rds file each time it is run. Update the function to work with pre-loaded model objects so that a model can be loaded once and used to predict multiple times without required the slow file loading process each time.
Currently, the predict_spectra() function loads an existing model from an .Rds file each time it is run. Update the function to work with pre-loaded model objects so that a model can be loaded once and used to predict multiple times without required the slow file loading process each time.