Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/profiling/profiling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ def annotate_pipeline(pipe):
method = getattr(component, method_name, None)
if method is None:
continue
setattr(component, method_name, annotate(method, label))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the example only supports a few pipeline types, we could condition this if "LTX2" in pipe.__class__.__name__ just to be cautious.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have scoped the fix to only apply to LTX2 pipelines to keep the change conservative.


# Apply fix ONLY for LTX2 pipelines
if "LTX2" in pipe.__class__.__name__:
func = getattr(method, "__func__", method)
wrapped = annotate(func, label)
bound_method = wrapped.__get__(component, type(component))
setattr(component, method_name, bound_method)
else:
# keep original behavior for other pipelines
setattr(component, method_name, annotate(method, label))

# Annotate pipeline-level methods
if hasattr(pipe, "encode_prompt"):
Expand Down
Loading