arise-sustech commited on
Commit
272c2ee
1 Parent(s): 877f2e7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -2
README.md CHANGED
@@ -52,7 +52,8 @@ for opt_state in OPT:
52
  subprocess.run(compile_command, shell=True, check=True)
53
 
54
  input_asm = ''
55
- asm = read_file(output_file+'.s')
 
56
  asm = asm.split('Disassembly of section .text:')[-1].strip()
57
  for tmp in asm.split('\n'):
58
  tmp_asm = tmp.split('\t')[-1]#remove the binary code
@@ -79,7 +80,7 @@ with open(fileName +'_' + opt_state +'.asm','r') as f:#original file
79
  asm_func = f.read()
80
  inputs = tokenizer(asm_func, return_tensors="pt").to(model.device)
81
  with torch.no_grad():
82
- outputs = model.generate(**inputs, max_new_tokens=200)
83
  c_func_decompile = tokenizer.decode(outputs[0][len(inputs[0]):-1])
84
  ```
85
 
 
52
  subprocess.run(compile_command, shell=True, check=True)
53
 
54
  input_asm = ''
55
+ with open(output_file+'.s') as f:#original file
56
+ asm= f.read()
57
  asm = asm.split('Disassembly of section .text:')[-1].strip()
58
  for tmp in asm.split('\n'):
59
  tmp_asm = tmp.split('\t')[-1]#remove the binary code
 
80
  asm_func = f.read()
81
  inputs = tokenizer(asm_func, return_tensors="pt").to(model.device)
82
  with torch.no_grad():
83
+ outputs = model.generate(**inputs, max_new_tokens=500)
84
  c_func_decompile = tokenizer.decode(outputs[0][len(inputs[0]):-1])
85
  ```
86