Spaces:
Runtime error
Runtime error
Edward J. Schwartz
commited on
Commit
•
5e7f50e
1
Parent(s):
9b17b18
Try again
Browse files
app.py
CHANGED
@@ -49,8 +49,7 @@ def get_all_dis(bname, addrs=None):
|
|
49 |
|
50 |
return func_dis
|
51 |
|
52 |
-
def get_funs(f
|
53 |
-
progress(0.0, "Identifying functions")
|
54 |
funs = get_all_dis(f.name)
|
55 |
return "\n".join(("%#x" % addr) for addr in funs.keys())
|
56 |
|
@@ -99,7 +98,7 @@ with gr.Blocks() as demo:
|
|
99 |
outputs=[all_dis_state, disassembly, clazz]
|
100 |
)
|
101 |
|
102 |
-
def file_change_fn(file):
|
103 |
|
104 |
if file is None:
|
105 |
return {col: gr.update(visible=False),
|
@@ -107,6 +106,7 @@ with gr.Blocks() as demo:
|
|
107 |
else:
|
108 |
|
109 |
#fun_data = {42: 2, 43: 3}
|
|
|
110 |
fun_data = get_all_dis(file.name)
|
111 |
|
112 |
addrs = ["%#x" % addr for addr in fun_data.keys()]
|
@@ -135,7 +135,7 @@ with gr.Blocks() as demo:
|
|
135 |
# for interpretation.
|
136 |
def interpretation_function(text, progress=gr.Progress(track_tqdm=True)):
|
137 |
|
138 |
-
progress(0
|
139 |
explainer = shap.Explainer(model_interp)
|
140 |
shap_values = explainer([text])
|
141 |
|
|
|
49 |
|
50 |
return func_dis
|
51 |
|
52 |
+
def get_funs(f):
|
|
|
53 |
funs = get_all_dis(f.name)
|
54 |
return "\n".join(("%#x" % addr) for addr in funs.keys())
|
55 |
|
|
|
98 |
outputs=[all_dis_state, disassembly, clazz]
|
99 |
)
|
100 |
|
101 |
+
def file_change_fn(file, progress=gr.Progress()):
|
102 |
|
103 |
if file is None:
|
104 |
return {col: gr.update(visible=False),
|
|
|
106 |
else:
|
107 |
|
108 |
#fun_data = {42: 2, 43: 3}
|
109 |
+
progress(0, desc="Disassembling executable")
|
110 |
fun_data = get_all_dis(file.name)
|
111 |
|
112 |
addrs = ["%#x" % addr for addr in fun_data.keys()]
|
|
|
135 |
# for interpretation.
|
136 |
def interpretation_function(text, progress=gr.Progress(track_tqdm=True)):
|
137 |
|
138 |
+
progress(0, desc="Interpreting function")
|
139 |
explainer = shap.Explainer(model_interp)
|
140 |
shap_values = explainer([text])
|
141 |
|