-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Namespace Objects for Search Parameters #556
Conversation
Realized I never quite said how they're related. It's a quality of life need for our users. For example, say I want to use the args = ModelSearchArguments()
args.model_name.search("resnet") To return all of the models that contain the name resnet (This then trickles to anything using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I like this a lot. Thanks for iterating with me on this, I think this should provide some very useful tooling for the model_list
/dataset_list
, and should provide a good platform on which we can build some useful methods in transformers
and others.
As said offline; the |
PR that adds the following:
Namespace Objects for Search Parameters
With a goal of adding more tab-completion to the library, this PR introduces two objects:
DatasetSearchArguments
ModelSearchArguments
These two
AttributeDictionary
objects contain all the valid information we can extract from a model as tab-complete parameters. We also include theauthor_or_organization
anddataset
(ormodel
)_name
as well through careful string splitting.Tests Added:
Considering there is nothing "new" done in
DatasetSearchArguments
that isn't already tested inDatasetTags
orAttributeDictionary.search
I chose not to add any tests here (especially because each call to theSearchArguments()
classes calls the api twice)If tests are wanted, I can include them.