Huggingface models: convert dataframe to list of dicts if using pipeline#1323
Merged
Huggingface models: convert dataframe to list of dicts if using pipeline#1323
Conversation
GSK-1482 Fix problem with HF pipeline models
HuggingFaceModel casts input to list before passing to the pipeline, but if the input is a dataframe (which is the case when the user did not provide a data_preprocessing_function) when casted to a list it will return the list of column names. |
|
Kudos, SonarCloud Quality Gate passed! |
andreybavt
reviewed
Aug 28, 2023
|
|
||
| def _get_predictions(self, data): | ||
| if isinstance(self.model, pipelines.Pipeline): | ||
| if isinstance(data, pd.DataFrame): |
Contributor
There was a problem hiding this comment.
did it break without to_dict conversion? Should we add another unit test specifically for this?
Member
Author
There was a problem hiding this comment.
Yes, when no preprocessing function was specified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








No description provided.