File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
torch_export_patches/patches Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1265,9 +1265,10 @@ def _size(name):
12651265 print (f"-- load ep { args .ep !r} " )
12661266 begin = time .perf_counter ()
12671267 # We need to load the plugs.
1268- from .torch_export_patches .patches .patch_transformers import PLUGS_Qwen25
1268+ from .torch_export_patches .patches .patch_transformers import get_transformers_plugs
12691269
1270- assert len (PLUGS_Qwen25 ) == 1 , "Missing PLUGS for Qwen2.5"
1270+ plugs = get_transformers_plugs ()
1271+ assert plugs , "Missing PLUGS for Qwen2.5"
12711272 ep = torch .export .load (args .ep )
12721273 print (f"-- done in { time .perf_counter () - begin :1.1f} s" )
12731274
Original file line number Diff line number Diff line change 11# transformers
2+ from typing import List
23from .patch_helper import _has_transformers
34
45from ._patch_transformers_attention import (
8687
8788
8889from ._patch_transformers_sam_mask_decoder import patched_SamMaskDecoder
90+
91+
92+ def get_transformers_plugs () -> List ["EagerDirectReplacementWithOnnx" ]: # noqa: F821
93+ """Returns the necessary plugs to rewrite models."""
94+ plugs = []
95+ if patch_qwen2_5 :
96+ plugs .extend (PLUGS_Qwen25 )
97+ return plugs
You can’t perform that action at this time.
0 commit comments