feat: added method to load pretrained models from huggingface#790
feat: added method to load pretrained models from huggingface#790lars-reimann merged 8 commits intomainfrom
Conversation
…alNetworkRegressor.load_pretrained_model` to load pretrained models from huggingface. Currently supports only Image models. feat: added `ModelImageSize`, `ConstantImageSize` and `VariableImageSize` feat: added support for `NeuralNetworkRegressor` with images of variable size. If you use a `VariableImageSize` any image which height and/or width are a multiple of the `VariableImageSize` are being supported by the model feat: added `NeuralNetworkClassifier.input_size` and `NeuralNetworkRegressor.input_size` feat: changed `Column.get_distinct_values` to keep order of values in column
NeuralNetworkClassifier.load_pretrained_model and NeuralNetworkRegressor.load_pretrained_model to load pretrained models from huggingface…face_interface
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
|
@lars-reimann do you have an idea how to test the pretrained models? Currently, those methods are not being tested. Maybe the same approach as in Safe-DS/Datasets#164 could work, but I would appreciate it if we could do this at a later date. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #790 +/- ##
==========================================
+ Coverage 97.74% 97.76% +0.01%
==========================================
Files 109 111 +2
Lines 5641 5691 +50
==========================================
+ Hits 5514 5564 +50
Misses 127 127 ☔ View full report in Codecov by Sentry. |
Not right now, no.
We've already used all our space for caches in this project (10GB), so that won't help us.
Sure, no problem. You can add a comment |
…face_interface # Conflicts: # src/safeds/ml/nn/layers/_flatten_layer.py
For testing these models, maybe it is enough for now that we check that the structure is correct. As example we could load an model into safe-ds and then check if its loaded correctly: |
## [0.26.0](v0.25.0...v0.26.0) (2024-05-29) ### Features * `Table.count_row_if` ([#788](#788)) ([4137131](4137131)), closes [#786](#786) * added method to load pretrained models from huggingface ([#790](#790)) ([dd8394b](dd8394b)) * infer input size of forward and LSTM layers ([#808](#808)) ([098a07f](098a07f)) * outline around dots of scatterplot ([#785](#785)) ([ee8acf7](ee8acf7)) * remove output conversions ([#792](#792)) ([46f2f5d](46f2f5d)), closes [#732](#732) * shorten some excessively long names ([#787](#787)) ([1c3ea59](1c3ea59)), closes [#772](#772) * specify column names in constructor of table transformers ([#795](#795)) ([69a780c](69a780c)) * store window size and forecast horizon in dataset ([#794](#794)) ([f07bc5a](f07bc5a)) * string operations on cells ([#791](#791)) ([4a17f76](4a17f76)) ### Bug Fixes * handling of boolean columns in column statistics ([#778](#778)) ([f61cceb](f61cceb)) * sort x values of line plot ([#782](#782)) ([74d8649](74d8649))
|
🎉 This PR is included in version 0.26.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary of Changes
feat: added
NeuralNetworkClassifier.load_pretrained_modelandNeuralNetworkRegressor.load_pretrained_modelto load pretrained models from huggingface. Currently supports only Image models.feat: added
ModelImageSize,ConstantImageSizeandVariableImageSizefeat: added support for
NeuralNetworkRegressorwith images of variable size. If you use aVariableImageSizeany image which height and/or width are a multiple of theVariableImageSizeare being supported by the modelfeat: added
NeuralNetworkClassifier.input_sizeandNeuralNetworkRegressor.input_sizefeat: changed
Column.get_distinct_valuesto keep order of values in column