Update app.py
Browse files
app.py
CHANGED
@@ -39,12 +39,22 @@ if st.button("Run Workflow"):
|
|
39 |
|
40 |
# Export workflow configuration as YAML or JSON
|
41 |
export_format = st.radio("Export Format", ["YAML", "JSON"])
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Export workflow configuration as YAML or JSON
|
41 |
export_format = st.radio("Export Format", ["YAML", "JSON"])
|
42 |
+
|
43 |
+
with open("workflow_config.yaml", "w") as yaml_file:
|
44 |
+
yaml.dump(workflow_config, yaml_file)
|
45 |
+
st.download_button(
|
46 |
+
label="Export Config",
|
47 |
+
data=yaml_file,
|
48 |
+
file_name='Workflow_Config.yaml',
|
49 |
+
mime='yaml',
|
50 |
+
)
|
51 |
+
|
52 |
+
# if st.download_button("Export Workflow"):
|
53 |
+
# if export_format == "YAML":
|
54 |
+
# with open("workflow_config.yaml", "w") as yaml_file:
|
55 |
+
# yaml.dump(workflow_config, yaml_file)
|
56 |
+
# st.success("Workflow configuration exported as YAML.")
|
57 |
+
# elif export_format == "JSON":
|
58 |
+
# with open("workflow_config.json", "w") as json_file:
|
59 |
+
# json.dump(workflow_config, json_file, indent=4)
|
60 |
+
# st.success("Workflow configuration exported as JSON.")
|