Daniel Fried commited on
Commit
0b6b3f9
1 Parent(s): 29e0eba
Files changed (2) hide show
  1. modules/app.py +1 -1
  2. static/index.html +3 -3
modules/app.py CHANGED
@@ -183,7 +183,7 @@ async def infill_maybe(info: str):
183
  extra_sentinel = True
184
  try:
185
  if len(form['parts']) > 4:
186
- return {'result': 'error', 'type': 'infill', 'message': f"error: Can't use more than 3 <infill> tokens in this demo (for efficiency)."}
187
  generation = infill(form['parts'], length_limit, temperature, extra_sentinel=extra_sentinel, max_retries=max_retries)
188
  generation['result'] = 'success'
189
  generation['type'] = 'infill'
 
183
  extra_sentinel = True
184
  try:
185
  if len(form['parts']) > 4:
186
+ return {'result': 'error', 'text': ''.join(form['parts']), 'type': 'infill', 'message': f"error: Can't use more than 3 <infill> tokens in this demo (for efficiency)."}
187
  generation = infill(form['parts'], length_limit, temperature, extra_sentinel=extra_sentinel, max_retries=max_retries)
188
  generation['result'] = 'success'
189
  generation['type'] = 'infill'
static/index.html CHANGED
@@ -218,8 +218,8 @@ label {
218
  </p>
219
 
220
  <p>
221
- For instructions on setting up and using the models (via HuggingFace transformers), see <a
222
- href="https://github.com/dpfried/incoder/blob/main/README.md">our readme</a>.
223
  </p>
224
 
225
  <h1 id="debug-info">Credits</h3>
@@ -540,7 +540,7 @@ function make_generate_listener(url) {
540
  $("#warning").text("");
541
  }
542
  } else {
543
- // set_text(data["prompt"])
544
  $("#error").text(receive_data["text"]);
545
  }
546
  }
 
218
  </p>
219
 
220
  <p>
221
+ For instructions on setting up and using the models (via HuggingFace transformers), see
222
+ <a href="https://github.com/dpfried/incoder/blob/main/README.md">our readme</a>.
223
  </p>
224
 
225
  <h1 id="debug-info">Credits</h3>
 
540
  $("#warning").text("");
541
  }
542
  } else {
543
+ set_text(receive_data["text"])
544
  $("#error").text(receive_data["text"]);
545
  }
546
  }