Spaces:
Runtime error
Runtime error
Update gradio_app.py
Browse files- gradio_app.py +7 -2
gradio_app.py
CHANGED
@@ -295,7 +295,7 @@ def chat_with_gpt(agent, user, context, user_message, history, max_length, top_k
|
|
295 |
return history, history, ""
|
296 |
|
297 |
|
298 |
-
with gr.Blocks() as demo:
|
299 |
gr.Markdown(HEADER)
|
300 |
with gr.Row():
|
301 |
with gr.Group():
|
@@ -353,7 +353,12 @@ with gr.Blocks() as demo:
|
|
353 |
hidden = gr.Textbox(visible=False, show_label=False)
|
354 |
with gr.Box():
|
355 |
# output = gr.Markdown()
|
356 |
-
output = gr.HighlightedText(
|
|
|
|
|
|
|
|
|
|
|
357 |
with gr.Row():
|
358 |
generate_btn = gr.Button("Generar")
|
359 |
generate_btn.click(complete_with_gpt, inputs=[textbox, max_length, top_k, top_p, temperature, do_sample, do_clean], outputs=[hidden, output])
|
|
|
295 |
return history, history, ""
|
296 |
|
297 |
|
298 |
+
with gr.Blocks(css="#htext span {white-space: pre}") as demo:
|
299 |
gr.Markdown(HEADER)
|
300 |
with gr.Row():
|
301 |
with gr.Group():
|
|
|
353 |
hidden = gr.Textbox(visible=False, show_label=False)
|
354 |
with gr.Box():
|
355 |
# output = gr.Markdown()
|
356 |
+
output = gr.HighlightedText(
|
357 |
+
elem_id="htext",
|
358 |
+
label="Resultado",
|
359 |
+
combine_adjacent=True,
|
360 |
+
color_map={AGENT: "green", "ERROR": "red", " ": "blue"},
|
361 |
+
)
|
362 |
with gr.Row():
|
363 |
generate_btn = gr.Button("Generar")
|
364 |
generate_btn.click(complete_with_gpt, inputs=[textbox, max_length, top_k, top_p, temperature, do_sample, do_clean], outputs=[hidden, output])
|