qqubb commited on
Commit
2e3d986
·
1 Parent(s): d596d39

remove unsued code, remove dividers

Browse files
Files changed (1) hide show
  1. app.py +2 -65
app.py CHANGED
@@ -4,69 +4,6 @@ import json
4
  from pathlib import Path
5
  from compliance_analysis import check_overall_compliance
6
 
7
- # def process_files(files):
8
- # results = []
9
- # for file in files:
10
- # with open(file.name, 'r') as f:
11
- # content = f.read()
12
- # if Path(file.name).name == "project_cc.yaml":
13
- # project_cc_yaml = yaml.safe_load(content)
14
- # msg = run_compliance_analysis_on_project(project_cc_yaml)
15
- # results.append(msg)
16
- # # if Path(file.name).name == "data_cc.yaml":
17
- # # data_cc_yaml = yaml.safe_load(content)
18
- # # msg = run_compliance_analysis_on_data(data_cc_yaml)
19
- # # results.append(msg)
20
- # # if Path(file.name).name == "model_cc.yaml":
21
- # # model_cc_yaml = yaml.safe_load(content)
22
- # # msg = run_compliance_analysis_on_model(model_cc_yaml)
23
- # # results.append(msg)
24
-
25
- # return results
26
-
27
- # def extract_properties(files):
28
- # for file in files:
29
- # with open(file.name, 'r') as f:
30
- # content = f.read()
31
- # project_cc_yaml = yaml.safe_load(content)
32
- # project_cc = [key for key in project_cc_yaml]
33
- # return project_cc
34
-
35
- # def sentence_builder(countries):
36
- # return f"{countries}"
37
-
38
- # # # Gradio interface
39
- # with gr.Blocks() as demo:
40
- # file_input = gr.File(label="Upload Files", file_count="multiple")
41
- # output = gr.Textbox(label="Output", lines=10)
42
-
43
- # submit_button = gr.Button("Process Files")
44
- # submit_button.click(process_files, inputs=file_input, outputs=output)
45
-
46
- # # Create the CheckboxGroup (initially empty)
47
- # checkbox_group = gr.CheckboxGroup(choices=[], label="", interactive=True)
48
-
49
- # # Create the output Textbox
50
- # output = gr.Textbox()
51
-
52
- # # Function to update the CheckboxGroup when files are uploaded
53
- # def update_checkboxes(files):
54
- # choices = extract_properties(files)
55
- # return gr.CheckboxGroup(choices=choices, label="", interactive=True)
56
-
57
- # # Create a Button to trigger the sentence builder
58
- # submit_button = gr.Button("Submit")
59
-
60
- # # Set up the interaction for file input and updating checkboxes
61
- # file_input.change(update_checkboxes, inputs=file_input, outputs=checkbox_group)
62
-
63
- # gr.CheckboxGroup.change(update_checkboxes)
64
-
65
- # output = gr.Textbox()
66
- # submit_button = gr.Button("Submit")
67
- # submit_button.click(sentence_builder, inputs=checkbox_group, outputs=output)
68
-
69
-
70
  # if __name__ == "__main__":
71
  # demo.launch()
72
 
@@ -205,8 +142,8 @@ if uploaded_files:
205
  for key, details in details.items():
206
  st.subheader(key.replace('_', ' ').title()) # section header
207
  details['value'] = st.checkbox(details['verbose'], value=details['value'])
208
- st.divider()
209
- st.divider()
210
  # st.write("Updated Data:", data)
211
 
212
  yaml_data = yaml.dump(data, sort_keys=False)
 
4
  from pathlib import Path
5
  from compliance_analysis import check_overall_compliance
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # if __name__ == "__main__":
8
  # demo.launch()
9
 
 
142
  for key, details in details.items():
143
  st.subheader(key.replace('_', ' ').title()) # section header
144
  details['value'] = st.checkbox(details['verbose'], value=details['value'])
145
+ # st.divider()
146
+ # st.divider()
147
  # st.write("Updated Data:", data)
148
 
149
  yaml_data = yaml.dump(data, sort_keys=False)