Spaces:
Runtime error
Runtime error
Edward J. Schwartz
commited on
Commit
·
1d7fc0d
1
Parent(s):
f2b6640
Try model
Browse files
app.py
CHANGED
|
@@ -76,7 +76,10 @@ with gr.Blocks() as demo:
|
|
| 76 |
with gr.Column(visible=False) as col:
|
| 77 |
#output = gr.Textbox("Output")
|
| 78 |
fun_dropdown = gr.Dropdown(label="Select a function", choices=["Woohoo!"], interactive=True)
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
def file_change_fn(file):
|
| 82 |
|
|
@@ -96,7 +99,12 @@ with gr.Blocks() as demo:
|
|
| 96 |
}
|
| 97 |
|
| 98 |
def function_change_fn(selected_fun, fun_data):
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
file_widget.change(file_change_fn, file_widget, [col, fun_dropdown, all_dis_state])
|
| 102 |
|
|
|
|
| 76 |
with gr.Column(visible=False) as col:
|
| 77 |
#output = gr.Textbox("Output")
|
| 78 |
fun_dropdown = gr.Dropdown(label="Select a function", choices=["Woohoo!"], interactive=True)
|
| 79 |
+
|
| 80 |
+
with gr.Row(visible=True) as result:
|
| 81 |
+
disassembly = gr.Textbox(label="Disassembly", lines=20, readonly=True)
|
| 82 |
+
clazz = gr.Label()
|
| 83 |
|
| 84 |
def file_change_fn(file):
|
| 85 |
|
|
|
|
| 99 |
}
|
| 100 |
|
| 101 |
def function_change_fn(selected_fun, fun_data):
|
| 102 |
+
|
| 103 |
+
disassembly_str = fun_data[int(selected_fun, 16)].decode("utf-8")
|
| 104 |
+
model_results = model(disassembly_str)
|
| 105 |
+
disassembly_str = str(model_results)
|
| 106 |
+
|
| 107 |
+
return {disassembly: gr.Textbox.update(value=disassembly_str)}
|
| 108 |
|
| 109 |
file_widget.change(file_change_fn, file_widget, [col, fun_dropdown, all_dis_state])
|
| 110 |
|