Plachta zelk12 commited on
Commit
b33cb65
1 Parent(s): d65174e

Fixed phoneme recording error (#8)

Browse files

- Fixed phoneme recording error (8d52ab1bfd566b4a85b4980b1e4f9b85deec2104)


Co-authored-by: Закиров Ленар <[email protected]>

Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -262,9 +262,9 @@ if __name__ == "__main__":
262
  symbol_input.change(to_symbol_fn,
263
  [symbol_input, textbox, temp_text_var],
264
  [textbox, temp_text_var])
265
- symbol_list.click(None, [symbol_list, symbol_list_json], [],
266
  _js=f"""
267
- (i, symbols) => {{
268
  let root = document.querySelector("body > gradio-app");
269
  if (root.shadowRoot != null)
270
  root = root.shadowRoot;
@@ -280,7 +280,10 @@ if __name__ == "__main__":
280
  text_input.selectionEnd = startPos + symbols[i].length;
281
  text_input.blur();
282
  window.scrollTo(x, y);
283
- return [];
 
 
 
284
  }}""")
285
  # select character
286
  char_dropdown = gr.Dropdown(choices=characters, value = "0:特别周", label='character')
 
262
  symbol_input.change(to_symbol_fn,
263
  [symbol_input, textbox, temp_text_var],
264
  [textbox, temp_text_var])
265
+ symbol_list.click(None, [symbol_list, symbol_list_json], textbox,
266
  _js=f"""
267
+ (i, symbols, text) => {{
268
  let root = document.querySelector("body > gradio-app");
269
  if (root.shadowRoot != null)
270
  root = root.shadowRoot;
 
280
  text_input.selectionEnd = startPos + symbols[i].length;
281
  text_input.blur();
282
  window.scrollTo(x, y);
283
+
284
+ text = text_input.value;
285
+
286
+ return text;
287
  }}""")
288
  # select character
289
  char_dropdown = gr.Dropdown(choices=characters, value = "0:特别周", label='character')