Skip to content

Commit

Permalink
update token viz sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshith-403 authored Oct 19, 2024
1 parent 635320e commit 7b8c4f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ This tool is used to visualize some metric related to tokens. This supports mult

```python
import inspectus

inspectus.tokens(['hello', 'world'], np.random.rand(2))
inspectus.tokens(["Hello", " World", "!"], {
'loss': [-7.375, -8.312, -7.5625],
'entropy': [3.323, 1.0666, 0.432]
}, token_info=["info 1", "info 2", "info 3"])
```

Check out the notebook here: [GPT2 example](https://github.com/labmlai/inspectus/blob/main/notebooks/token_viz.ipynb)
Expand Down

0 comments on commit 7b8c4f5

Please sign in to comment.