Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
374968b
1
Parent(s):
bbc1fe3
placeholder
Browse files
app.py
CHANGED
@@ -20,21 +20,21 @@ vardecoder_model = AutoModelForCausalLM.from_pretrained(
|
|
20 |
"ejschwartz/resym-vardecoder", torch_dtype=torch.bfloat16, device_map="auto"
|
21 |
)
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
|
40 |
@spaces.GPU
|
@@ -53,5 +53,5 @@ def infer(input):
|
|
53 |
output = first_token + ':' + output
|
54 |
return output
|
55 |
|
56 |
-
demo = gr.Interface(fn=infer, inputs=gr.Textbox(lines=10), outputs=gr.Text())
|
57 |
demo.launch()
|
|
|
20 |
"ejschwartz/resym-vardecoder", torch_dtype=torch.bfloat16, device_map="auto"
|
21 |
)
|
22 |
|
23 |
+
example = """{
|
24 |
+
"input": "What are the original name and data type of variables `a1`, `a2`, `k`, `j`, `i`?\n```\n_BYTE *__fastcall sub_4022CD(_BYTE *a1, __int64 a2)\n{\n_BYTE *result; // rax\n__int16 v4; // [rsp+1Ch] [rbp-14h]\nunsigned __int16 v5; // [rsp+1Eh] [rbp-12h]\nunsigned __int16 v6; // [rsp+20h] [rbp-10h]\nunsigned __int16 v7; // [rsp+22h] [rbp-Eh]\nunsigned int k; // [rsp+24h] [rbp-Ch]\nunsigned int j; // [rsp+28h] [rbp-8h]\nunsigned int i; // [rsp+2Ch] [rbp-4h]\n\nfor ( i = 0; i <= 2; ++i )\n{\nfor ( j = 0; j <= 0x3F; ++j )\n{\nfor ( k = 0; k <= 3; ++k )\n{\n*(&v4 + k) = *(_WORD *)(a2 + 2 * (k + 4 * j + ((unsigned __int64)i << 8)));\n*(&v4 + k) += (*(&v4 + k) >> 15) & 0xD01;\n*(&v4 + k) = ((((unsigned __int16)*(&v4 + k) << 10) + 1664) / 0xD01u) & 0x3FF;\n}\n*a1 = v4;\na1[1] = (4 * v5) | HIBYTE(v4);\na1[2] = (16 * v6) | (v5 >> 6);\na1[3] = ((_BYTE)v7 << 6) | (v6 >> 4);\nresult = a1 + 4;\na1[4] = v7 >> 2;\na1 += 5;\n}\n}\nreturn result;\n}\n```",
|
25 |
+
"output": "a1: r, uint8_t*\na2: a, const polyvec*\nk: t, uint16_t\nj: -, -\ni: k, unsigned int",
|
26 |
+
"funname": "pqcrystals_kyber768_ref_polyvec_compress",
|
27 |
+
"bin": "6ea440a6c772bc0d6a6089c9ff33ae31da13daf3b72acbe175674b0bb21987ed",
|
28 |
+
"proj": "pq-crystals/kyber",
|
29 |
+
"cluster_var": {
|
30 |
+
"array": [
|
31 |
+
[
|
32 |
+
"k",
|
33 |
+
"j"
|
34 |
+
]
|
35 |
+
]
|
36 |
+
}
|
37 |
+
}"""
|
38 |
|
39 |
|
40 |
@spaces.GPU
|
|
|
53 |
output = first_token + ':' + output
|
54 |
return output
|
55 |
|
56 |
+
demo = gr.Interface(fn=infer, inputs=gr.Textbox(lines=10, placeholder=example), outputs=gr.Text())
|
57 |
demo.launch()
|