princemaxp commited on
Commit
15cd72a
·
verified ·
1 Parent(s): f3aa8db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,11 +9,11 @@ def html_to_pdf(html_content):
9
  HTML(string=html_content).write_pdf(tmp_pdf.name)
10
  return tmp_pdf.name
11
 
12
- def analyze_email(file_obj, export_pdf=False):
13
- if file_obj is None:
14
  return "<p style='color:red;'>Please upload a .eml file to analyze.</p>", None
15
 
16
- results = analyze(file_obj.name)
17
 
18
  # Basic verdict info
19
  attack_score = results[0]
@@ -93,7 +93,7 @@ def analyze_email(file_obj, export_pdf=False):
93
  demo = gr.Interface(
94
  fn=analyze_email,
95
  inputs=[
96
- gr.File(label="Upload .eml File", type="file"),
97
  gr.Checkbox(label="Export PDF Report")
98
  ],
99
  outputs=[
 
9
  HTML(string=html_content).write_pdf(tmp_pdf.name)
10
  return tmp_pdf.name
11
 
12
+ def analyze_email(file_path, export_pdf=False):
13
+ if file_path is None:
14
  return "<p style='color:red;'>Please upload a .eml file to analyze.</p>", None
15
 
16
+ results = analyze(file_path)
17
 
18
  # Basic verdict info
19
  attack_score = results[0]
 
93
  demo = gr.Interface(
94
  fn=analyze_email,
95
  inputs=[
96
+ gr.File(label="Upload .eml File", type="filepath"),
97
  gr.Checkbox(label="Export PDF Report")
98
  ],
99
  outputs=[