psaiops 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl
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.
psaiops/score/attention/app.py
CHANGED
|
@@ -10,6 +10,13 @@ STYLE = ''''''
|
|
|
10
10
|
|
|
11
11
|
MODEL = 'openai/gpt-oss-20b'
|
|
12
12
|
|
|
13
|
+
# COLORS #######################################################################
|
|
14
|
+
|
|
15
|
+
def create_color_map() -> dict:
|
|
16
|
+
return {
|
|
17
|
+
'-1': '#00ff00',
|
|
18
|
+
**{str(__i): '#{:02x}0000'.format(__i) for __i in range(101)}}
|
|
19
|
+
|
|
13
20
|
# INTRO ########################################################################
|
|
14
21
|
|
|
15
22
|
def create_intro_block(intro: str) -> dict:
|
|
@@ -54,7 +61,7 @@ def create_inputs_block() -> dict:
|
|
|
54
61
|
# OUTPUTS ######################################################################
|
|
55
62
|
|
|
56
63
|
def create_outputs_block() -> dict:
|
|
57
|
-
__output = gradio.HighlightedText(label='Scores', value='', interactive=False, show_legend=False, show_inline_category=False, combine_adjacent=True)
|
|
64
|
+
__output = gradio.HighlightedText(label='Scores', value='', interactive=False, show_legend=False, show_inline_category=False, combine_adjacent=True, color_map=create_color_map())
|
|
58
65
|
return {'output_block': __output}
|
|
59
66
|
|
|
60
67
|
# ACTIONS ######################################################################
|
psaiops/score/attention/lib.py
CHANGED
|
@@ -123,8 +123,8 @@ def postprocess_attention_scores(
|
|
|
123
123
|
__input_scores = torch.round(100.0 * __input_scores, decimals=0).type(torch.int32)
|
|
124
124
|
# the generated tokens are not scored
|
|
125
125
|
__output_scores = torch.where(__output_mask, -1, 0).type(torch.int32)
|
|
126
|
-
# native list of integers
|
|
127
|
-
return __input_scores.tolist() + __output_scores.tolist() # (I,) + (O,) = (T,)
|
|
126
|
+
# native list of serialized integers
|
|
127
|
+
return [str(__i) for __i in __input_scores.tolist() + __output_scores.tolist()] # (I,) + (O,) = (T,)
|
|
128
128
|
|
|
129
129
|
# POSTPROCESS ####################################################################
|
|
130
130
|
|
|
@@ -7,9 +7,9 @@ psaiops/elements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
7
7
|
psaiops/elements/data.py,sha256=vGYeMN11uP9gs8rV6aSDffE_TeIX5PmdzWGwUpdGE2Y,906
|
|
8
8
|
psaiops/score/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
psaiops/score/attention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
psaiops/score/attention/app.py,sha256=
|
|
11
|
-
psaiops/score/attention/lib.py,sha256=
|
|
10
|
+
psaiops/score/attention/app.py,sha256=3kltkxpbSNXWAGuzhO1cXNnGUOWNFBgUHA17wJMrICU,6803
|
|
11
|
+
psaiops/score/attention/lib.py,sha256=MCpXql8INTdXnFkEBoyJp-unazC9nGbD7y81G2z3l9U,6958
|
|
12
12
|
psaiops/steer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
psaiops-0.0.
|
|
14
|
-
psaiops-0.0.
|
|
15
|
-
psaiops-0.0.
|
|
13
|
+
psaiops-0.0.4.dist-info/METADATA,sha256=xOUeGbX3yfu06s2HLDPtYkHC8StVNUJB7DQ-kH_J0E0,1221
|
|
14
|
+
psaiops-0.0.4.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
15
|
+
psaiops-0.0.4.dist-info/RECORD,,
|
|
File without changes
|