MCPcopy Index your code
hub / github.com/huggingface/diffusers / renew_attention_paths

Function renew_attention_paths

scripts/convert_i2vgen_to_diffusers.py:79–88  ·  view source on GitHub ↗

Updates paths inside attentions to the new naming scheme (local renaming)

(old_list, n_shave_prefix_segments=0)

Source from the content-addressed store, hash-verified

77
78
79def renew_attention_paths(old_list, n_shave_prefix_segments=0):
80 """
81 Updates paths inside attentions to the new naming scheme (local renaming)
82 """
83 mapping = []
84 for old_item in old_list:
85 new_item = old_item
86 mapping.append({"old": old_item, "new": new_item})
87
88 return mapping
89
90
91def shave_segments(path, n_shave_prefix_segments=1):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…