Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,9 @@ def main():
|
|
66 |
if model_name.startswith("textattack/"):
|
67 |
model.config.id2label = {0: "NEGATIVE (0) ", 1: "POSITIVE (1)"}
|
68 |
model.eval()
|
|
|
69 |
cls_explainer = SequenceClassificationExplainer(model=model, tokenizer=tokenizer)
|
|
|
70 |
if cls_explainer.accepts_position_ids:
|
71 |
emb_type_name = st.sidebar.selectbox(
|
72 |
"Choose embedding type for attribution.", ["word", "position"]
|
@@ -84,7 +86,7 @@ def main():
|
|
84 |
explanation_classes,
|
85 |
)
|
86 |
my_expander = st.beta_expander(
|
87 |
-
"Click here for description of models and their tasks"
|
88 |
)
|
89 |
with my_expander:
|
90 |
st.json(models)
|
@@ -96,7 +98,7 @@ def main():
|
|
96 |
height=400,
|
97 |
max_chars=850,
|
98 |
)
|
99 |
-
|
100 |
if st.button("Interpret Text"):
|
101 |
#print_memory_usage()
|
102 |
|
|
|
66 |
if model_name.startswith("textattack/"):
|
67 |
model.config.id2label = {0: "NEGATIVE (0) ", 1: "POSITIVE (1)"}
|
68 |
model.eval()
|
69 |
+
print ("Model Evaluated")
|
70 |
cls_explainer = SequenceClassificationExplainer(model=model, tokenizer=tokenizer)
|
71 |
+
print ("Model Explained")
|
72 |
if cls_explainer.accepts_position_ids:
|
73 |
emb_type_name = st.sidebar.selectbox(
|
74 |
"Choose embedding type for attribution.", ["word", "position"]
|
|
|
86 |
explanation_classes,
|
87 |
)
|
88 |
my_expander = st.beta_expander(
|
89 |
+
"Click here for a description of models and their tasks"
|
90 |
)
|
91 |
with my_expander:
|
92 |
st.json(models)
|
|
|
98 |
height=400,
|
99 |
max_chars=850,
|
100 |
)
|
101 |
+
print ("Before button")
|
102 |
if st.button("Interpret Text"):
|
103 |
#print_memory_usage()
|
104 |
|