ejschwartz commited on
Commit
e55b49e
·
verified ·
1 Parent(s): 239b615

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -9,7 +9,7 @@ def predict(decompiled_code):
9
  with tempfile.TemporaryDirectory() as temp_dir:
10
 
11
  code_file_name = os.path.join(temp_dir, "code.decompiled")
12
- field_file_name = os.path.join(temp_dir, "code.fields")
13
 
14
  with open(code_file_name, "w") as f:
15
  f.write('#include "/home/ReSym/clang-parser/defs.hh"\n' + decompiled_code)
@@ -19,7 +19,8 @@ def predict(decompiled_code):
19
  print(output)
20
  print(output.stdout)
21
 
22
- return open(field_file_name).read()
 
23
 
24
  def run():
25
  demo = gr.Interface(
 
9
  with tempfile.TemporaryDirectory() as temp_dir:
10
 
11
  code_file_name = os.path.join(temp_dir, "code.decompiled")
12
+ field_file_name = os.path.join(temp_dir, "code.json")
13
 
14
  with open(code_file_name, "w") as f:
15
  f.write('#include "/home/ReSym/clang-parser/defs.hh"\n' + decompiled_code)
 
19
  print(output)
20
  print(output.stdout)
21
 
22
+ field_data = open(field_file_name).read()
23
+ return field_data
24
 
25
  def run():
26
  demo = gr.Interface(