michaelmc1618 commited on
Commit
04e48f0
·
verified ·
1 Parent(s): ca2e727

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- # Load and preprocess JSON data for the AI model
57
- json_data = json.load(file)
 
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)