psaiops 0.0.8__tar.gz → 0.0.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of psaiops might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: psaiops
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Web apps to inspect & engineer NN activations.
5
5
  License: .github/LICENSE.md
6
6
  Author: apehex
@@ -10,7 +10,7 @@ import psaiops.score.attention.lib
10
10
 
11
11
  TITLE = '''Attention Scoring'''
12
12
  INTRO = '''Score each token according to the weights of the attention layers.\nThe model is fixed to "openai/gpt-oss-20b" for now.'''
13
- STYLE = ''''''
13
+ STYLE = '''.white-text span { color: white; }'''
14
14
 
15
15
  MODEL = 'openai/gpt-oss-20b'
16
16
 
@@ -19,7 +19,7 @@ MODEL = 'openai/gpt-oss-20b'
19
19
  def create_color_map() -> dict:
20
20
  return {
21
21
  '-1': '#00ff00',
22
- **{str(__i): '#{:02x}0000'.format(__i) for __i in range(101)}}
22
+ **{str(__i): '#{:02x}0000'.format(int(2.55 * __i)) for __i in range(101)}}
23
23
 
24
24
  # INTRO ########################################################################
25
25
 
@@ -65,7 +65,7 @@ def create_inputs_block() -> dict:
65
65
  # OUTPUTS ######################################################################
66
66
 
67
67
  def create_outputs_block() -> dict:
68
- __output = gradio.HighlightedText(label='Scores', value='', interactive=False, show_legend=False, show_inline_category=False, combine_adjacent=True, color_map=create_color_map())
68
+ __output = gradio.HighlightedText(label='Scores', value='', interactive=False, show_legend=False, show_inline_category=False, combine_adjacent=True, color_map=create_color_map(), elem_classes='white-text')
69
69
  return {'output_block': __output}
70
70
 
71
71
  # ACTIONS ######################################################################
@@ -59,7 +59,7 @@ def generate_token_ids(
59
59
  output_hidden_states=False,
60
60
  output_attentions=False,
61
61
  output_scores=False,
62
- early_stopping=True,
62
+ # early_stopping=True,
63
63
  use_cache=True)
64
64
  # full sequence
65
65
  return __outputs.sequences # (1, T)
@@ -186,7 +186,7 @@ def score_tokens(
186
186
  token_idx=token_idx)
187
187
  # detokenize the IDs
188
188
  __tokens = postprocess_token_ids(
189
- tokenizer_obj=__tokenizer,
189
+ tokenizer_obj=tokenizer_obj,
190
190
  token_obj=__outputs)
191
191
  # match tokens and labels for the HighlightedText field
192
192
  return list(zip(__tokens, __labels))
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "psaiops"
3
- version = "0.0.8"
3
+ version = "0.0.10"
4
4
  description = "Web apps to inspect & engineer NN activations."
5
5
  license = ".github/LICENSE.md"
6
6
  readme = ".github/README.md"
File without changes
File without changes