AutoModel#11115
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
sayakpaul
left a comment
There was a problem hiding this comment.
Nice! I think this will be so much better as an UX improvement. Cc: @vladmandic you might like this :)
Let's add docs and tests after @DN6 reviews.
|
I anticipate this functionality to be quite helpful in a future version of diffusers. Does it make sense to add this PR to the future release section of the diffusers roadmap? |
|
Hi @ParagEkbote, I've added this to the roadmap, we will aim to get it included with the next release. |
|
an idea - to really make automodel as simple as possible, add default |
|
@vladmandic Do you have an example pseudo-code of your expected usage? |
sorry, i was too fast with my comment. if using auto-pipeline, we dont know what's the model ahead of time. one thing with automodel i'd love to see is the model type. |
| config = cls.load_config(pretrained_model_or_path, **load_config_kwargs) | ||
| orig_class_name = config["_class_name"] | ||
|
|
||
| model_cls = _get_task_class(AUTO_MODEL_MAPPING, orig_class_name) |
There was a problem hiding this comment.
Rather than maintain this big mapping can't we use importlib? All the models are available in the main diffusers init right? Similar to how we do it here?
diffusers/src/diffusers/pipelines/pipeline_loading_utils.py
Lines 354 to 358 in c51b6bd
There was a problem hiding this comment.
yeah, agree, probably don't need a mapping here, could use the same logic as in from_pretrained
There was a problem hiding this comment.
if we can get rid of mapping, everything will be supported automatically too I think
| requires_backends(cls, ["torch"]) | ||
|
|
||
|
|
||
| class TransformerTemporalModel(metaclass=DummyObject): |
There was a problem hiding this comment.
It was missing, needed to be added for the test to pass.
What does this PR do?
Fixes #10059
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.