Skip to content

Apply code suggestion #14

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

Merged
merged 4 commits into from
Sep 15, 2022
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
4 changes: 2 additions & 2 deletions src/diffusers_interpret/token_attributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __getitem__(self, item: Union[str, int]) -> Any:
def __setitem__(self, key: Union[str, int], value: Any) -> None:
setattr(self, key, value)

def plot(self, plot_type: str = 'barh', title: str = 'Token Attributions', **plot_kwargs) -> None:
def plot(self, plot_type: str = 'barh', **plot_kwargs) -> None:
'''
Plot the token attributions to have a comparative view.
Available plot types include bar chart, horizontal bar chart, and pie chart.
Expand All @@ -23,7 +23,7 @@ def plot(self, plot_type: str = 'barh', title: str = 'Token Attributions', **plo
# get arguments from plot_kwargs
xlabel = plot_kwargs.get('xlabel')
ylabel = plot_kwargs.get('ylabel')
title = plot_kwargs.get('title') or title
title = plot_kwargs.get('title') or 'Token Attributions'

if plot_type == 'bar':
# Bar chart
Expand Down