Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,8 +53,9 @@ def evaluate_pci_compliance(audit_data):
|
|
53 |
return compliance_analysis
|
54 |
|
55 |
def analyze_json_file(file):
|
56 |
-
#
|
57 |
-
|
|
|
58 |
audit_data = json.dumps(json_data, indent=2) # Convert JSON to a formatted string
|
59 |
return audit_data
|
60 |
|
@@ -149,4 +150,4 @@ with gr.Blocks(css=custom_css) as demo:
|
|
149 |
clear_btn = gr.Button("Clear")
|
150 |
clear_btn.click(lambda: ("", "", ""), None, [json_file, gdpr_compliance, pci_compliance])
|
151 |
|
152 |
-
demo.launch()
|
|
|
53 |
return compliance_analysis
|
54 |
|
55 |
def analyze_json_file(file):
|
56 |
+
# Convert the file's bytes to a JSON-serializable string and parse it
|
57 |
+
file_str = file.read().decode("utf-8")
|
58 |
+
json_data = json.loads(file_str)
|
59 |
audit_data = json.dumps(json_data, indent=2) # Convert JSON to a formatted string
|
60 |
return audit_data
|
61 |
|
|
|
150 |
clear_btn = gr.Button("Clear")
|
151 |
clear_btn.click(lambda: ("", "", ""), None, [json_file, gdpr_compliance, pci_compliance])
|
152 |
|
153 |
+
demo.launch(share=True)
|