Sasidhar commited on
Commit
4c88397
·
1 Parent(s): 7082c91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -9
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
- if st.button("Export Workflow"):
43
- if export_format == "YAML":
44
- with open("workflow_config.yaml", "w") as yaml_file:
45
- yaml.dump(workflow_config, yaml_file)
46
- st.success("Workflow configuration exported as YAML.")
47
- elif export_format == "JSON":
48
- with open("workflow_config.json", "w") as json_file:
49
- json.dump(workflow_config, json_file, indent=4)
50
- st.success("Workflow configuration exported as JSON.")
 
 
 
 
 
 
 
 
 
 
 
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.")