fix render html code
This commit is contained in:
@@ -39,7 +39,7 @@ model_configs = {
|
|||||||
"""
|
"""
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
"Qwen2.5-Coder-3B-Instruct-w8w8": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
|
"Qwen2.5-Coder-3B-Instruct-w8w8-For-clear-code": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Qwen2.5-Coder-3B-Instruct-w8w8": {
|
"Qwen2.5-Coder-3B-Instruct-w8w8": {
|
||||||
|
|||||||
@@ -66,13 +66,16 @@ if __name__ == "__main__":
|
|||||||
# Компонент для отображения HTML-ответа
|
# Компонент для отображения HTML-ответа
|
||||||
output_html = gr.HTML(label="Ответ LLM")
|
output_html = gr.HTML(label="Ответ LLM")
|
||||||
def process_txt2txt(input_text):
|
def process_txt2txt(input_text):
|
||||||
return input_text
|
html = input_text.replace("\t", "").replace("\n", "")
|
||||||
|
result = f"<iframe srcdoc='{html}' width='100%' height='1000'></iframe>"
|
||||||
|
return result
|
||||||
|
|
||||||
submit_button.click(
|
submit_button.click(
|
||||||
process_txt2txt,
|
process_txt2txt,
|
||||||
inputs=input_text,
|
inputs=input_text,
|
||||||
outputs=output_html
|
outputs=output_html
|
||||||
)
|
)
|
||||||
|
|
||||||
# with gr.TabItem("Txt2Mesh"):
|
# with gr.TabItem("Txt2Mesh"):
|
||||||
# with gr.Row():
|
# with gr.Row():
|
||||||
# with gr.Column(scale=2):
|
# with gr.Column(scale=2):
|
||||||
|
|||||||
Reference in New Issue
Block a user