Edward J. Schwartz commited on
Commit
b1fd156
·
1 Parent(s): 1f9e351
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -11,6 +11,7 @@ import numpy
11
  print(numpy.__version__)
12
 
13
  pipe = transformers.pipeline(model="ejschwartz/oo-method-test-model-bylibrary", top_k=2)
 
14
 
15
  # gr.load("ejschwartz/oo-method-test-model-bylibrary", src="models", examples=[
16
  # '\nL1: 55 ?? push ebp\n 8b ec ?? mov ebp, esp\n 5d ?? pop ebp\n c3 ?? ret\n\n',
@@ -104,8 +105,9 @@ with gr.Blocks() as demo:
104
 
105
  disassembly_str = fun_data[int(selected_fun, 16)].decode("utf-8")
106
  model_results = pipe(disassembly_str)
107
- top_k = {i["label"].split(", ")[0]: i["score"] for i in model_results}
108
- #disassembly_str = str(model_results)
 
109
 
110
  return {disassembly: gr.Textbox.update(value=disassembly_str),
111
  clazz: gr.Label.update(top_k)
 
11
  print(numpy.__version__)
12
 
13
  pipe = transformers.pipeline(model="ejschwartz/oo-method-test-model-bylibrary", top_k=2)
14
+ model = gr.load("ejschwartz/oo-method-test-model-bylibrary", src="models")
15
 
16
  # gr.load("ejschwartz/oo-method-test-model-bylibrary", src="models", examples=[
17
  # '\nL1: 55 ?? push ebp\n 8b ec ?? mov ebp, esp\n 5d ?? pop ebp\n c3 ?? ret\n\n',
 
105
 
106
  disassembly_str = fun_data[int(selected_fun, 16)].decode("utf-8")
107
  model_results = pipe(disassembly_str)
108
+ load_results = model(disassembly_str)
109
+ #top_k = {i["label"].split(", ")[0]: i["score"] for i in model_results}
110
+ disassembly_str = str(model_results) + str(load_results)
111
 
112
  return {disassembly: gr.Textbox.update(value=disassembly_str),
113
  clazz: gr.Label.update(top_k)