Spaces:
Sleeping
Sleeping
Daniel Fried
commited on
Commit
•
537df60
1
Parent(s):
b72509b
update style; iframe hack
Browse files- modules/app.py +2 -4
- static/index.html +12 -5
modules/app.py
CHANGED
@@ -9,10 +9,8 @@ if os.path.exists('use_normal_tokenizers'):
|
|
9 |
CUDA = False
|
10 |
else:
|
11 |
import tokenizers_patch
|
12 |
-
|
13 |
-
|
14 |
-
BIG_MODEL = False
|
15 |
-
CUDA = False
|
16 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
17 |
import json
|
18 |
|
|
|
9 |
CUDA = False
|
10 |
else:
|
11 |
import tokenizers_patch
|
12 |
+
BIG_MODEL = True
|
13 |
+
CUDA = True
|
|
|
|
|
14 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
15 |
import json
|
16 |
|
static/index.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="utf-8"/>
|
5 |
-
<meta name="viewport" contents="width=device-width" />
|
6 |
<title>InCoder</title>
|
7 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.14/ace.min.js"></script>
|
@@ -35,6 +35,9 @@
|
|
35 |
} */
|
36 |
/* .leftside {
|
37 |
} */
|
|
|
|
|
|
|
38 |
.rightside {
|
39 |
width: 30em;
|
40 |
}
|
@@ -86,7 +89,7 @@
|
|
86 |
|
87 |
label {
|
88 |
margin-top: 1em;
|
89 |
-
display: inline-
|
90 |
width: 10em;
|
91 |
text-align: right;
|
92 |
font-size: 80%;
|
@@ -119,6 +122,7 @@ label {
|
|
119 |
}
|
120 |
</style>
|
121 |
<body>
|
|
|
122 |
<div class="card" id="about">
|
123 |
<div class="header"> <h1>InCoder: A Generative Model for Code Infilling and Synthesis</h1> </div>
|
124 |
<p>Demo of the 6.7B parameter version of InCoder: a decoder-only Transformer model that can both extend and insert/infill code.</p>
|
@@ -147,7 +151,7 @@ label {
|
|
147 |
</div>
|
148 |
<div class="card" id="controls">
|
149 |
<div>
|
150 |
-
<label>
|
151 |
<input type="range" value="64" min="16" max="256" step="16" class="slider"
|
152 |
oninput="this.nextElementSibling.value = this.value" name="length" id='length_slider'>
|
153 |
<output class='a' id="length_slider_output">64</output>
|
@@ -219,11 +223,12 @@ label {
|
|
219 |
</p>
|
220 |
|
221 |
<h1 id="debug-info">Credits</h3>
|
222 |
-
<p>
|
223 |
-
Wen-tau Yih, Luke Zettlemoyer, and Mike Lewis
|
224 |
<p>Thanks to Naman Goyal and Stephen Roller for writing the code this was based on. Extensions by Daniel Fried and
|
225 |
Sida Wang.</p>
|
226 |
</div>
|
|
|
227 |
<script type="text/javascript">
|
228 |
// these constants are only used for providing user expectations.
|
229 |
var OVERHEAD = 3;
|
@@ -337,6 +342,7 @@ def count_words(filename):
|
|
337 |
};
|
338 |
|
339 |
var editor = ace.edit("editor");
|
|
|
340 |
|
341 |
function set_editor_mode(mode) {
|
342 |
session = editor.session
|
@@ -582,5 +588,6 @@ $(document).ready(function() {
|
|
582 |
// set_editor_mode("python");
|
583 |
});
|
584 |
</script>
|
|
|
585 |
</body>
|
586 |
</html>
|
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="utf-8"/>
|
5 |
+
<meta name="viewport" contents="width=device-width, initial-scale=1.0" />
|
6 |
<title>InCoder</title>
|
7 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.14/ace.min.js"></script>
|
|
|
35 |
} */
|
36 |
/* .leftside {
|
37 |
} */
|
38 |
+
main {
|
39 |
+
max-width: 80rem;
|
40 |
+
}
|
41 |
.rightside {
|
42 |
width: 30em;
|
43 |
}
|
|
|
89 |
|
90 |
label {
|
91 |
margin-top: 1em;
|
92 |
+
display: inline-elock;
|
93 |
width: 10em;
|
94 |
text-align: right;
|
95 |
font-size: 80%;
|
|
|
122 |
}
|
123 |
</style>
|
124 |
<body>
|
125 |
+
<main>
|
126 |
<div class="card" id="about">
|
127 |
<div class="header"> <h1>InCoder: A Generative Model for Code Infilling and Synthesis</h1> </div>
|
128 |
<p>Demo of the 6.7B parameter version of InCoder: a decoder-only Transformer model that can both extend and insert/infill code.</p>
|
|
|
151 |
</div>
|
152 |
<div class="card" id="controls">
|
153 |
<div>
|
154 |
+
<label>Num Tokens:</label>
|
155 |
<input type="range" value="64" min="16" max="256" step="16" class="slider"
|
156 |
oninput="this.nextElementSibling.value = this.value" name="length" id='length_slider'>
|
157 |
<output class='a' id="length_slider_output">64</output>
|
|
|
223 |
</p>
|
224 |
|
225 |
<h1 id="debug-info">Credits</h3>
|
226 |
+
<p>This model was developed at Facebook AI Research by Daniel Fried*, Armen Aghajanyan*, Jessy Lin, Sida Wang, Eric Wallace, Freda Shi, Ruiqi Zhong,
|
227 |
+
Wen-tau Yih, Luke Zettlemoyer, and Mike Lewis.</p>
|
228 |
<p>Thanks to Naman Goyal and Stephen Roller for writing the code this was based on. Extensions by Daniel Fried and
|
229 |
Sida Wang.</p>
|
230 |
</div>
|
231 |
+
</main>
|
232 |
<script type="text/javascript">
|
233 |
// these constants are only used for providing user expectations.
|
234 |
var OVERHEAD = 3;
|
|
|
342 |
};
|
343 |
|
344 |
var editor = ace.edit("editor");
|
345 |
+
//var editor = null;
|
346 |
|
347 |
function set_editor_mode(mode) {
|
348 |
session = editor.session
|
|
|
588 |
// set_editor_mode("python");
|
589 |
});
|
590 |
</script>
|
591 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
|
592 |
</body>
|
593 |
</html>
|