add new line
Browse files
app.py
CHANGED
@@ -31,11 +31,11 @@ def get_answer(user_input, decoding_methods, num_beams, top_k, top_p, temperatur
|
|
31 |
answer_without_prompt = answer[len(prompt)+1:]
|
32 |
user_input_en = translate(user_input, "en", "id")
|
33 |
answer_without_prompt_en = translate(answer_without_prompt, "en", "id")
|
34 |
-
return [(f"{user_input}
|
35 |
-
[(f"{user_input_en}
|
36 |
|
37 |
|
38 |
-
with gr.Blocks() as demo:
|
39 |
with gr.Row():
|
40 |
gr.Markdown("""## IndoChat
|
41 |
|
@@ -66,6 +66,7 @@ with gr.Blocks() as demo:
|
|
66 |
generated_answer = gr.HighlightedText(
|
67 |
label="Generated Text",
|
68 |
combine_adjacent=True,
|
|
|
69 |
).style(color_map={"": "blue", "-": "green"})
|
70 |
generated_answer_en = gr.HighlightedText(
|
71 |
label="Translation",
|
|
|
31 |
answer_without_prompt = answer[len(prompt)+1:]
|
32 |
user_input_en = translate(user_input, "en", "id")
|
33 |
answer_without_prompt_en = translate(answer_without_prompt, "en", "id")
|
34 |
+
return [(f"{user_input}\n", None), (answer_without_prompt, "")], \
|
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 |
|
|
|
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",
|