ejschwartz commited on
Commit
e2f9f6a
·
1 Parent(s): 6ab20b3

fix example

Browse files
Files changed (1) hide show
  1. app.py +11 -15
app.py CHANGED
@@ -45,20 +45,16 @@ fielddecoder_model = AutoModelForCausalLM.from_pretrained(
45
  "ejschwartz/resym-vardecoder", torch_dtype=torch.bfloat16, device_map="auto"
46
  )
47
 
48
- example = r"""{
49
- "input": "What are the original name and data type of variables `a1`, `a2`, `a3`, `v4`, `v5`?\n```\n__int64 __fastcall sub_410D81(__int64 a1, __int64 a2, __int64 a3)\n{\nint v4; // [rsp+20h] [rbp-20h] BYREF\n__int64 v5; // [rsp+28h] [rbp-18h]\n\nif ( !a1 || !a2 || !a3 )\nreturn 0LL;\nv4 = 5;\nv5 = a3;\nreturn sub_411142(a1, a2, &v4);\n}\n```",
50
- "output": "a1: dict, pdfio_dict_t*\na2: key, const char*\na3: value, pdfio_dict_t*\nv4: temp, struct _pdfio_value_t\nv5: -, -",
51
- "funname": "pdfioDictSetDict",
52
- "bin": "d0ebaa77558783765df381826c961e95c83338e285011d501a62bea474e93451",
53
- "proj": "michaelrsweet/pdfio",
54
- "cluster_var": {
55
- "struct": [
56
- [
57
- "v4",
58
- "v5"
59
- ]
60
- ]
61
- }
62
  }"""
63
 
64
 
@@ -106,7 +102,7 @@ def infer(code):
106
  demo = gr.Interface(
107
  fn=infer,
108
  inputs=[
109
- gr.Textbox(lines=10, value=json.loads(example)['input']),
110
  ],
111
  outputs=[gr.Text(label="Var Decoder Output"),
112
  gr.Text(label="Generated Variable List")],
 
45
  "ejschwartz/resym-vardecoder", torch_dtype=torch.bfloat16, device_map="auto"
46
  )
47
 
48
+ example = r"""__int64 __fastcall sub_410D81(__int64 a1, __int64 a2, __int64 a3)
49
+ {
50
+ int v4; // [rsp+20h] [rbp-20h] BYREF
51
+ __int64 v5; // [rsp+28h] [rbp-18h]
52
+
53
+ if ( !a1 || !a2 || !a3 )
54
+ return 0LL;
55
+ v4 = 5;
56
+ v5 = a3;
57
+ return sub_411142(a1, a2, &v4);
 
 
 
 
58
  }"""
59
 
60
 
 
102
  demo = gr.Interface(
103
  fn=infer,
104
  inputs=[
105
+ gr.Textbox(lines=10, value=example),
106
  ],
107
  outputs=[gr.Text(label="Var Decoder Output"),
108
  gr.Text(label="Generated Variable List")],