Skip to content

Commit

Permalink
Remove remaining references to Penzai from NNX.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689590143
  • Loading branch information
danieldjohnson authored and Flax Authors committed Oct 25, 2024
1 parent 40f080e commit e78eecf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs_nnx/guides/gemma.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"outputs": [],
"source": [
"! pip install --no-deps -U flax\n",
"! pip install jaxtyping kagglehub penzai"
"! pip install jaxtyping kagglehub treescope"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs_nnx/guides/gemma.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You will find in this colab a detailed tutorial explaining how to use NNX to loa

```{code-cell} ipython3
! pip install --no-deps -U flax
! pip install jaxtyping kagglehub penzai
! pip install jaxtyping kagglehub treescope
```

## Downloading the checkpoint
Expand Down
7 changes: 3 additions & 4 deletions flax/nnx/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,9 @@ def __nnx_repr__(self):
yield reprlib.Attr('type', self.type.__name__)
yield reprlib.Attr('index', self.index)

def __penzai_repr__(self, path, subtree_renderer):
from penzai.treescope import repr_lib as pz_repr_lib # type: ignore[import-not-found,import-untyped]

return pz_repr_lib.render_object_constructor(
def __treescope_repr__(self, path, subtree_renderer):
import treescope # type: ignore[import-not-found,import-untyped]
return treescope.repr_lib.render_object_constructor(
object_type=type(self),
attributes={'type': self.type, 'index': self.index},
path=path,
Expand Down

0 comments on commit e78eecf

Please sign in to comment.