cahya commited on
Commit
3284509
1 Parent(s): 3aa662c

add id to highlightedtext

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -35,7 +35,7 @@ def get_answer(user_input, decoding_methods, num_beams, top_k, top_p, temperatur
35
  [(f"{user_input_en}\n", None), (answer_without_prompt_en, "")]
36
 
37
 
38
- with gr.Blocks(css="#htext span {white-space: pre-line}") as demo:
39
  with gr.Row():
40
  gr.Markdown("""## IndoChat
41
 
@@ -64,11 +64,13 @@ with gr.Blocks(css="#htext span {white-space: pre-line}") as demo:
64
  with gr.Column():
65
  # generated_answer = gr.Textbox()
66
  generated_answer = gr.HighlightedText(
 
67
  label="Generated Text",
68
  combine_adjacent=True,
69
  css="#htext span {white-space: pre-line}",
70
  ).style(color_map={"": "blue", "-": "green"})
71
  generated_answer_en = gr.HighlightedText(
 
72
  label="Translation",
73
  combine_adjacent=True,
74
  ).style(color_map={"": "blue", "-": "green"})
 
35
  [(f"{user_input_en}\n", None), (answer_without_prompt_en, "")]
36
 
37
 
38
+ with gr.Blocks(css="#answer_id span {white-space: pre-line} #answer_en span {white-space: pre-line}") as demo:
39
  with gr.Row():
40
  gr.Markdown("""## IndoChat
41
 
 
64
  with gr.Column():
65
  # generated_answer = gr.Textbox()
66
  generated_answer = gr.HighlightedText(
67
+ elem_id="answer_id",
68
  label="Generated Text",
69
  combine_adjacent=True,
70
  css="#htext span {white-space: pre-line}",
71
  ).style(color_map={"": "blue", "-": "green"})
72
  generated_answer_en = gr.HighlightedText(
73
+ elem_id="answer_en",
74
  label="Translation",
75
  combine_adjacent=True,
76
  ).style(color_map={"": "blue", "-": "green"})