Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f3827d2
1
Parent(s):
8e536a8
Move description to README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🐢
|
4 |
colorFrom: green
|
5 |
colorTo: indigo
|
@@ -9,4 +9,35 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: ReSym Test Space
|
3 |
emoji: 🐢
|
4 |
colorFrom: green
|
5 |
colorTo: indigo
|
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
+
# ReSym Test Space
|
13 |
+
|
14 |
+
This is a test space of the models from the [ReSym
|
15 |
+
artifacts](https://github.com/lt-asset/resym). Sadly, at the time I am writing
|
16 |
+
this, not all of ReSym is publicly available; specifically, the Prolog component
|
17 |
+
is [not available](https://github.com/lt-asset/resym/issues/2).
|
18 |
+
|
19 |
+
This space simply performs inference on the two pretrained models available as
|
20 |
+
part of the ReSym artifacts. It takes a variable name and some decompiled code
|
21 |
+
as input, and outputs the variable type and other information.
|
22 |
+
|
23 |
+
The examples are randomly selected from `vardecoder_test.jsonl`.
|
24 |
+
|
25 |
+
## Disclaimer
|
26 |
+
|
27 |
+
I'm not a ReSym developer and I may have messed something up. In particular,
|
28 |
+
you must prompt the variable names in the decompiled code as part of the prompt,
|
29 |
+
and I reused some of their own code to do this.
|
30 |
+
|
31 |
+
## Oddities
|
32 |
+
|
33 |
+
### sub_40FD86
|
34 |
+
|
35 |
+
We do not get the same results for sub_40FD86. In fact, we don't create the same prompt. The prompt in `vardecoder_test.jsonl` is:
|
36 |
+
|
37 |
+
What are the original name and data type of variables `v3`, `v4`, `v5`?
|
38 |
+
|
39 |
+
It's unclear why a1, a2, and result are not listed.
|
40 |
+
|
41 |
+
## Todo
|
42 |
+
|
43 |
+
* Add field decoding (probably needs Docker)
|
app.py
CHANGED
@@ -9,31 +9,6 @@ import huggingface_hub
|
|
9 |
|
10 |
import prep_decompiled
|
11 |
|
12 |
-
description = """# ReSym Test Space
|
13 |
-
|
14 |
-
This is a test space of the models from the [ReSym
|
15 |
-
artifacts](https://github.com/lt-asset/resym). Sadly, at the time I am writing
|
16 |
-
this, not all of ReSym is publicly available; specifically, the Prolog component
|
17 |
-
is [not available](https://github.com/lt-asset/resym/issues/2).
|
18 |
-
|
19 |
-
This space simply performs inference on the two pretrained models available as
|
20 |
-
part of the ReSym artifacts. It takes a variable name and some decompiled code
|
21 |
-
as input, and outputs the variable type and other information.
|
22 |
-
|
23 |
-
The examples are randomly selected from `vardecoder_test.jsonl`.
|
24 |
-
|
25 |
-
## Disclaimer
|
26 |
-
|
27 |
-
I'm not a ReSym developer and I may have messed something up. In particular,
|
28 |
-
you must prompt the variable names in the decompiled code as part of the prompt,
|
29 |
-
and I reused some of their own code to do this.
|
30 |
-
|
31 |
-
## Todo
|
32 |
-
|
33 |
-
* Add field decoding (probably needs Docker)
|
34 |
-
|
35 |
-
"""
|
36 |
-
|
37 |
hf_key = os.environ["HF_TOKEN"]
|
38 |
huggingface_hub.login(token=hf_key)
|
39 |
|
@@ -122,7 +97,7 @@ def infer(code):
|
|
122 |
# )
|
123 |
|
124 |
var_output = var_name + ":" + var_output
|
125 |
-
#field_output = var_name + ":" + field_output
|
126 |
return var_output, varstring
|
127 |
|
128 |
|
@@ -136,7 +111,7 @@ demo = gr.Interface(
|
|
136 |
# gr.Text(label="Field Decoder Output"),
|
137 |
gr.Text(label="Generated Variable List"),
|
138 |
],
|
139 |
-
description=
|
140 |
examples=examples,
|
141 |
)
|
142 |
demo.launch()
|
|
|
9 |
|
10 |
import prep_decompiled
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
hf_key = os.environ["HF_TOKEN"]
|
13 |
huggingface_hub.login(token=hf_key)
|
14 |
|
|
|
97 |
# )
|
98 |
|
99 |
var_output = var_name + ":" + var_output
|
100 |
+
# field_output = var_name + ":" + field_output
|
101 |
return var_output, varstring
|
102 |
|
103 |
|
|
|
111 |
# gr.Text(label="Field Decoder Output"),
|
112 |
gr.Text(label="Generated Variable List"),
|
113 |
],
|
114 |
+
description=open("README.md").read(),
|
115 |
examples=examples,
|
116 |
)
|
117 |
demo.launch()
|