Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloa
|
|
9 |
|
10 |
@spaces.GPU
|
11 |
def predict(input_asm):
|
12 |
-
|
13 |
before = f"# This is the assembly code:\n"#prompt
|
14 |
after = "\n# What is the source code?\n"#prompt
|
15 |
input_prompt = before+input_asm.strip()+after
|
@@ -21,7 +21,27 @@ def predict(input_asm):
|
|
21 |
return c_func_decompile
|
22 |
|
23 |
demo = gr.Interface(fn=predict,
|
24 |
-
examples=["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
inputs="text", outputs="text")
|
26 |
demo.queue()
|
27 |
demo.launch()
|
|
|
9 |
|
10 |
@spaces.GPU
|
11 |
def predict(input_asm):
|
12 |
+
input_asm = '\n'.join(c_func).strip()
|
13 |
before = f"# This is the assembly code:\n"#prompt
|
14 |
after = "\n# What is the source code?\n"#prompt
|
15 |
input_prompt = before+input_asm.strip()+after
|
|
|
21 |
return c_func_decompile
|
22 |
|
23 |
demo = gr.Interface(fn=predict,
|
24 |
+
examples=["""undefined4 func0(float param_1,long param_2,int param_3)
|
25 |
+
{
|
26 |
+
int local_28;
|
27 |
+
int local_24;
|
28 |
+
|
29 |
+
local_24 = 0;
|
30 |
+
do {
|
31 |
+
local_28 = local_24;
|
32 |
+
if (param_3 <= local_24) {
|
33 |
+
return 0;
|
34 |
+
}
|
35 |
+
while (local_28 = local_28 + 1, local_28 < param_3) {
|
36 |
+
if ((double)((ulong)(double)(*(float *)(param_2 + (long)local_24 * 4) -
|
37 |
+
*(float *)(param_2 + (long)local_28 * 4)) &
|
38 |
+
SUB168(_DAT_00402010,0)) < (double)param_1) {
|
39 |
+
return 1;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
local_24 = local_24 + 1;
|
43 |
+
} while( true );
|
44 |
+
}"""],
|
45 |
inputs="text", outputs="text")
|
46 |
demo.queue()
|
47 |
demo.launch()
|