Update app.py
Browse files
app.py
CHANGED
|
@@ -82,14 +82,21 @@ with gr.Blocks() as demo:
|
|
| 82 |
status = gr.Markdown(visible=False)
|
| 83 |
|
| 84 |
with gr.Column():
|
| 85 |
-
output = gr.
|
| 86 |
|
| 87 |
def wrapper(name, description, architecture, components, deployment, platform, extra):
|
| 88 |
result = generate_software_spec(name, description, architecture, components, deployment, platform, extra)
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
def show_spinner():
|
| 92 |
-
return gr.update(visible=True, value="⏳ Generating... Please wait.")
|
| 93 |
|
| 94 |
submit.click(fn=show_spinner, inputs=[], outputs=[status], queue=False)
|
| 95 |
submit.click(
|
|
|
|
| 82 |
status = gr.Markdown(visible=False)
|
| 83 |
|
| 84 |
with gr.Column():
|
| 85 |
+
output = gr.HTML(label="Output")
|
| 86 |
|
| 87 |
def wrapper(name, description, architecture, components, deployment, platform, extra):
|
| 88 |
result = generate_software_spec(name, description, architecture, components, deployment, platform, extra)
|
| 89 |
+
html_content = """
|
| 90 |
+
<div>{}</div>
|
| 91 |
+
<script type='module'>
|
| 92 |
+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
| 93 |
+
mermaid.initialize({startOnLoad: true});
|
| 94 |
+
</script>
|
| 95 |
+
""".format(result)
|
| 96 |
+
return html_content, gr.update(visible=False)
|
| 97 |
|
| 98 |
def show_spinner():
|
| 99 |
+
return gr.update(visible=True, value="<center>⏳ Generating... Please wait.</center>")
|
| 100 |
|
| 101 |
submit.click(fn=show_spinner, inputs=[], outputs=[status], queue=False)
|
| 102 |
submit.click(
|