Spaces:
Runtime error
Runtime error
viz
Browse files- app.py +2 -2
- error_analysis/utils/style_hacks.py +11 -6
app.py
CHANGED
|
@@ -236,14 +236,14 @@ if __name__ == "__main__":
|
|
| 236 |
st.session_state["embedding"] = embedding_umap
|
| 237 |
|
| 238 |
with lcol:
|
| 239 |
-
st.
|
| 240 |
dataframe = data_df[['content', 'label', 'pred', 'loss']].sort_values(
|
| 241 |
by=['loss'], ascending=False)
|
| 242 |
table_html = dataframe.to_html(
|
| 243 |
columns=['content', 'label', 'pred', 'loss'], max_rows=100)
|
| 244 |
# table_html = table_html.replace("<th>", '<th align="left">') # left-align the headers
|
| 245 |
st.write(dataframe)
|
| 246 |
-
st.
|
| 247 |
commontokens = frequent_tokens(data_df, tokenizer, loss_quantile=loss_quantile)
|
| 248 |
st.write(commontokens)
|
| 249 |
# st_aggrid.AgGrid(dataframe)
|
|
|
|
| 236 |
st.session_state["embedding"] = embedding_umap
|
| 237 |
|
| 238 |
with lcol:
|
| 239 |
+
st.markdown('<h3>Error Slices</h3>',unsafe_allow_html=True)
|
| 240 |
dataframe = data_df[['content', 'label', 'pred', 'loss']].sort_values(
|
| 241 |
by=['loss'], ascending=False)
|
| 242 |
table_html = dataframe.to_html(
|
| 243 |
columns=['content', 'label', 'pred', 'loss'], max_rows=100)
|
| 244 |
# table_html = table_html.replace("<th>", '<th align="left">') # left-align the headers
|
| 245 |
st.write(dataframe)
|
| 246 |
+
st.markdown('<h3>Word Distribution in Error Slice</h3>', unsafe_allow_html=True)
|
| 247 |
commontokens = frequent_tokens(data_df, tokenizer, loss_quantile=loss_quantile)
|
| 248 |
st.write(commontokens)
|
| 249 |
# st_aggrid.AgGrid(dataframe)
|
error_analysis/utils/style_hacks.py
CHANGED
|
@@ -11,20 +11,25 @@ def init_style():
|
|
| 11 |
/* Side Bar */
|
| 12 |
[data-testid="stSidebar"][aria-expanded="true"] > div:first-child {
|
| 13 |
width: 225px;
|
|
|
|
| 14 |
}
|
| 15 |
[data-testid="stSidebar"][aria-expanded="false"] > div:first-child {
|
| 16 |
-
width:
|
| 17 |
margin-left: -500px;
|
| 18 |
}
|
|
|
|
|
|
|
|
|
|
| 19 |
.css-1outpf7 {
|
| 20 |
background-color:rgb(254 244 219);
|
| 21 |
width:10rem;
|
| 22 |
padding:10px 10px 10px 10px;
|
| 23 |
}
|
| 24 |
-
/* Main Panel*/
|
| 25 |
-
|
| 26 |
margin-left: -200px;
|
| 27 |
-
|
|
|
|
| 28 |
.css-18e3th9 {
|
| 29 |
padding:10px 10px 10px -200px;
|
| 30 |
}
|
|
@@ -59,10 +64,10 @@ def init_style():
|
|
| 59 |
.sectionHeader {
|
| 60 |
font-size:10px;
|
| 61 |
}
|
| 62 |
-
|
| 63 |
font-family: sans-serif;
|
| 64 |
font-weight: 500;
|
| 65 |
-
font-size: 1.5 rem;
|
| 66 |
color: rgb(250, 250, 250);
|
| 67 |
padding: 1.25rem 0px 1rem;
|
| 68 |
margin: 0px;
|
|
|
|
| 11 |
/* Side Bar */
|
| 12 |
[data-testid="stSidebar"][aria-expanded="true"] > div:first-child {
|
| 13 |
width: 225px;
|
| 14 |
+
margin-left: -500px;
|
| 15 |
}
|
| 16 |
[data-testid="stSidebar"][aria-expanded="false"] > div:first-child {
|
| 17 |
+
width: 225px;
|
| 18 |
margin-left: -500px;
|
| 19 |
}
|
| 20 |
+
[data-testid="stSidebar"]{
|
| 21 |
+
flex-basis: unset;
|
| 22 |
+
}
|
| 23 |
.css-1outpf7 {
|
| 24 |
background-color:rgb(254 244 219);
|
| 25 |
width:10rem;
|
| 26 |
padding:10px 10px 10px 10px;
|
| 27 |
}
|
| 28 |
+
/* Main Panel*/
|
| 29 |
+
[data-testid="stVerticalBlock"]{
|
| 30 |
margin-left: -200px;
|
| 31 |
+
padding:10px 10px 10px -200px;
|
| 32 |
+
}
|
| 33 |
.css-18e3th9 {
|
| 34 |
padding:10px 10px 10px -200px;
|
| 35 |
}
|
|
|
|
| 64 |
.sectionHeader {
|
| 65 |
font-size:10px;
|
| 66 |
}
|
| 67 |
+
[data-testid="stMarkdownContainer]{
|
| 68 |
font-family: sans-serif;
|
| 69 |
font-weight: 500;
|
| 70 |
+
font-size: 1.5 rem !important;
|
| 71 |
color: rgb(250, 250, 250);
|
| 72 |
padding: 1.25rem 0px 1rem;
|
| 73 |
margin: 0px;
|