Spaces:
Runtime error
Runtime error
Alexander Seifert
commited on
Commit
•
a2351d6
1
Parent(s):
fb9cb6e
update
Browse files- main.py +2 -2
- subpages/attention.py +1 -1
- subpages/lossy_samples.py +1 -0
- subpages/random_samples.py +0 -2
main.py
CHANGED
@@ -75,9 +75,9 @@ def main():
|
|
75 |
HiddenStatesPage(),
|
76 |
ProbingPage(),
|
77 |
MetricsPage(),
|
78 |
-
MisclassifiedPage(),
|
79 |
-
LossesPage(),
|
80 |
LossySamplesPage(),
|
|
|
|
|
81 |
RandomSamplesPage(),
|
82 |
FindDuplicatesPage(),
|
83 |
InspectPage(),
|
|
|
75 |
HiddenStatesPage(),
|
76 |
ProbingPage(),
|
77 |
MetricsPage(),
|
|
|
|
|
78 |
LossySamplesPage(),
|
79 |
+
LossesPage(),
|
80 |
+
MisclassifiedPage(),
|
81 |
RandomSamplesPage(),
|
82 |
FindDuplicatesPage(),
|
83 |
InspectPage(),
|
subpages/attention.py
CHANGED
@@ -103,7 +103,7 @@ class AttentionPage(Page):
|
|
103 |
def get_widget_defaults(self):
|
104 |
return {
|
105 |
"act_n_components": 8,
|
106 |
-
"act_default_text": """Now I ask you:
|
107 |
"act_from_layer": 0,
|
108 |
"act_to_layer": 6,
|
109 |
}
|
|
|
103 |
def get_widget_defaults(self):
|
104 |
return {
|
105 |
"act_n_components": 8,
|
106 |
+
"act_default_text": """Now I ask you: what can be expected of man since he is a being endowed with strange qualities? Shower upon him every earthly blessing, drown him in a sea of happiness, so that nothing but bubbles of bliss can be seen on the surface; give him economic prosperity, such that he should have nothing else to do but sleep, eat cakes and busy himself with the continuation of his species, and even then out of sheer ingratitude, sheer spite, man would play you some nasty trick. He would even risk his cakes and would deliberately desire the most fatal rubbish, the most uneconomical absurdity, simply to introduce into all this positive good sense his fatal fantastic element. It is just his fantastic dreams, his vulgar folly that he will desire to retain, simply in order to prove to himself--as though that were so necessary-- that men still are men and not the keys of a piano, which the laws of nature threaten to control so completely that soon one will be able to desire nothing but by the calendar. And that is not all: even if man really were nothing but a piano-key, even if this were proved to him by natural science and mathematics, even then he would not become reasonable, but would purposely do something perverse out of simple ingratitude, simply to gain his point. And if he does not find means he will contrive destruction and chaos, will contrive sufferings of all sorts, only to gain his point! He will launch a curse upon the world, and as only man can curse (it is his privilege, the primary distinction between him and other animals), may be by his curse alone he will attain his object--that is, convince himself that he is a man and not a piano-key!""",
|
107 |
"act_from_layer": 0,
|
108 |
"act_to_layer": 6,
|
109 |
}
|
subpages/lossy_samples.py
CHANGED
@@ -82,6 +82,7 @@ td {
|
|
82 |
)
|
83 |
# styler.data = styler.data.astype(str)
|
84 |
st.write(styler.to_html(), unsafe_allow_html=True)
|
|
|
85 |
# st.dataframe(colorize_classes(sample.drop("hidden_states", axis=1)))#.bar(subset='losses')) # type: ignore
|
86 |
# st.write(
|
87 |
# colorize_errors(sample.round(3).drop("hidden_states", axis=1).astype(str))
|
|
|
82 |
)
|
83 |
# styler.data = styler.data.astype(str)
|
84 |
st.write(styler.to_html(), unsafe_allow_html=True)
|
85 |
+
st.write("")
|
86 |
# st.dataframe(colorize_classes(sample.drop("hidden_states", axis=1)))#.bar(subset='losses')) # type: ignore
|
87 |
# st.write(
|
88 |
# colorize_errors(sample.round(3).drop("hidden_states", axis=1).astype(str))
|
subpages/random_samples.py
CHANGED
@@ -33,7 +33,6 @@ class RandomSamplesPage(Page):
|
|
33 |
|
34 |
random_indices = context.df.sample(int(random_sample_size)).index
|
35 |
samples = context.df_tokens_merged.loc[random_indices]
|
36 |
-
return
|
37 |
|
38 |
for i, idx in enumerate(random_indices):
|
39 |
sample = samples.loc[idx]
|
@@ -47,5 +46,4 @@ class RandomSamplesPage(Page):
|
|
47 |
loss = f"<span title='total loss' style='display: block; background-color: yellow; color: gray; padding: 0 5px;'>𝐿 {sample.losses.sum():.3f}</span>"
|
48 |
col1.write(f"{counter}{loss}", unsafe_allow_html=True)
|
49 |
col1.write("")
|
50 |
-
st.write(sample.astype(str))
|
51 |
col2.write(htmlify_labeled_example(sample), unsafe_allow_html=True)
|
|
|
33 |
|
34 |
random_indices = context.df.sample(int(random_sample_size)).index
|
35 |
samples = context.df_tokens_merged.loc[random_indices]
|
|
|
36 |
|
37 |
for i, idx in enumerate(random_indices):
|
38 |
sample = samples.loc[idx]
|
|
|
46 |
loss = f"<span title='total loss' style='display: block; background-color: yellow; color: gray; padding: 0 5px;'>𝐿 {sample.losses.sum():.3f}</span>"
|
47 |
col1.write(f"{counter}{loss}", unsafe_allow_html=True)
|
48 |
col1.write("")
|
|
|
49 |
col2.write(htmlify_labeled_example(sample), unsafe_allow_html=True)
|