daqc commited on
Commit
e061bc4
·
verified ·
1 Parent(s): 1b3e476

Update scripts/report_generator.py

Browse files
Files changed (1) hide show
  1. scripts/report_generator.py +2 -1
scripts/report_generator.py CHANGED
@@ -25,6 +25,7 @@ class HFLinkReportTool(Tool):
25
  import json as _json
26
  doc_title = title or "Report"
27
  query = (query or "").strip()
 
28
 
29
  # Extract URLs
30
  urls = re.findall(r"https?://[^\s)\]]+", final_answer or "")
@@ -129,7 +130,7 @@ class HFLinkReportTool(Tool):
129
  <script src=\"https://cdn.jsdelivr.net/npm/dompurify@3.1.6/dist/purify.min.js\"></script>
130
  </head>
131
  <body>
132
- <div class=\"container\">{('<div class=\\"header\\"><div><div class=\\"title\\">' + title + '</div></div></div>') if title else ''}
133
  <h2>You may be interested <span class=\"warn\" title=\"Links may be AI‑generated and might not resolve.\">⚠️</span></h2>
134
  <div class=\"stats\">{chips_section()}</div>
135
  {section('Models', cats['models'], 'models')}
 
25
  import json as _json
26
  doc_title = title or "Report"
27
  query = (query or "").strip()
28
+ header_html = f"<div class=\"header\"><div><div class=\"title\">{title}</div></div></div>" if title else ""
29
 
30
  # Extract URLs
31
  urls = re.findall(r"https?://[^\s)\]]+", final_answer or "")
 
130
  <script src=\"https://cdn.jsdelivr.net/npm/dompurify@3.1.6/dist/purify.min.js\"></script>
131
  </head>
132
  <body>
133
+ <div class=\"container\">{header_html}
134
  <h2>You may be interested <span class=\"warn\" title=\"Links may be AI‑generated and might not resolve.\">⚠️</span></h2>
135
  <div class=\"stats\">{chips_section()}</div>
136
  {section('Models', cats['models'], 'models')}