Skip to content
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

No gridlines on token attr plots+typo fix #1355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions captum/attr/_core/llm_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def plot_token_attr(

fig, ax = plt.subplots()

# Hide the grid
ax.grid(False)

# Plot the heatmap
data = token_attr.numpy()

Expand Down Expand Up @@ -119,7 +122,7 @@ def plot_token_attr(

# Create colorbar
cbar = fig.colorbar(im, ax=ax) # type: ignore
cbar.ax.set_ylabel("Token Attribuiton", rotation=-90, va="bottom")
cbar.ax.set_ylabel("Token Attribution", rotation=-90, va="bottom")

# Show all ticks and label them with the respective list entries.
shortened_tokens = [
Expand Down Expand Up @@ -204,7 +207,7 @@ def plot_seq_attr(
color="#d0365b",
)

ax.set_ylabel("Sequence Attribuiton", rotation=90, va="bottom")
ax.set_ylabel("Sequence Attribution", rotation=90, va="bottom")

if show:
plt.show()
Expand Down
Loading