Spaces:
Running
Running
Show 20 closest-token results by default
Browse files- README.md +1 -1
- viewer_ui.py +1 -1
README.md
CHANGED
|
@@ -44,7 +44,7 @@ Inspect individual token embeddings as coloured lines, or show the range between
|
|
| 44 |
3. Under **Display**, choose **Individual tokens** to see all available tokens as separate coloured lines. This is the default, and works with a single token. Click a legend entry to hide or show a line.
|
| 45 |
4. Choose **Range between two tokens** to select **First token** and **Second token** and show their ribbon. Tick **Show average** to display the centre line, or untick it to show the range alone. Switching modes keeps your tokens, line colours, selected pair and average setting.
|
| 46 |
5. To reuse that change, tick **Move range to another token** and choose a **New starting token** from your available tokens. The solid green edge follows that token; the dashed orange edge is the calculated endpoint: `new start + (second − first)`. This preserves the signed difference at every dimension, including where the original curves cross. It is not a constant vertical shift.
|
| 47 |
-
6. Click **Find matching tokens** to scan the vocabulary for real tokens closest to the dashed edge. Each result has **Show on chart** / **Hide from chart**. Change **Number of matches** to show up to 50 results without rescanning. Changing the pair or starting token requires a new search. The input tokens are excluded. Matches use Euclidean distance across all raw embedding dimensions: lower is closer and 0 is exact. Numerical matches do not guarantee a meaningful word analogy.
|
| 48 |
|
| 49 |
The horizontal axis is embedding dimension; the vertical axis is the stored value. The band's edges are the two tokens' values, its centre line is their average, and a wider band means a larger absolute gap. The band pinches to zero where the values meet. Hover for both values, their average and their difference. Drag to zoom and double-click to reset.
|
| 50 |
|
|
|
|
| 44 |
3. Under **Display**, choose **Individual tokens** to see all available tokens as separate coloured lines. This is the default, and works with a single token. Click a legend entry to hide or show a line.
|
| 45 |
4. Choose **Range between two tokens** to select **First token** and **Second token** and show their ribbon. Tick **Show average** to display the centre line, or untick it to show the range alone. Switching modes keeps your tokens, line colours, selected pair and average setting.
|
| 46 |
5. To reuse that change, tick **Move range to another token** and choose a **New starting token** from your available tokens. The solid green edge follows that token; the dashed orange edge is the calculated endpoint: `new start + (second − first)`. This preserves the signed difference at every dimension, including where the original curves cross. It is not a constant vertical shift.
|
| 47 |
+
6. Click **Find matching tokens** to scan the vocabulary for real tokens closest to the dashed edge. Each result has **Show on chart** / **Hide from chart**. The list shows 20 results by default. Change **Number of matches** to show up to 50 results without rescanning. Changing the pair or starting token requires a new search. The input tokens are excluded. Matches use Euclidean distance across all raw embedding dimensions: lower is closer and 0 is exact. Numerical matches do not guarantee a meaningful word analogy.
|
| 48 |
|
| 49 |
The horizontal axis is embedding dimension; the vertical axis is the stored value. The band's edges are the two tokens' values, its centre line is their average, and a wider band means a larger absolute gap. The band pinches to zero where the values meet. Hover for both values, their average and their difference. Drag to zoom and double-click to reset.
|
| 50 |
|
viewer_ui.py
CHANGED
|
@@ -187,7 +187,7 @@ def render_viewer(model, tokenizer, loaded, display_name):
|
|
| 187 |
result_key = f'move_results:{scope}'
|
| 188 |
with model_panel:
|
| 189 |
st.subheader('Closest tokens')
|
| 190 |
-
count = st.number_input('Number of matches', min_value=1, max_value=50, value=
|
| 191 |
key=f'move_count:{scope}')
|
| 192 |
st.caption('Distance measures the difference from the dashed curve across all dimensions. '
|
| 193 |
'Lower is closer; 0 is an exact match. The three input tokens are excluded.')
|
|
|
|
| 187 |
result_key = f'move_results:{scope}'
|
| 188 |
with model_panel:
|
| 189 |
st.subheader('Closest tokens')
|
| 190 |
+
count = st.number_input('Number of matches', min_value=1, max_value=50, value=20,
|
| 191 |
key=f'move_count:{scope}')
|
| 192 |
st.caption('Distance measures the difference from the dashed curve across all dimensions. '
|
| 193 |
'Lower is closer; 0 is an exact match. The three input tokens are excluded.')
|