Deevyankar commited on
Commit
fe0db2c
·
verified ·
1 Parent(s): e1fb09a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -53,8 +53,12 @@ def compare_all(old_pdf, new_pdf, lo_file):
53
  summary += "🆕 Significant changes detected."
54
 
55
  # LO comparison
56
- los = lo_file.read().decode("utf-8", errors="ignore").splitlines()
57
- los = [lo.strip() for lo in los if lo.strip()]
 
 
 
 
58
  if not los:
59
  return summary + "\n⚠️ No valid Learning Outcomes found.", None, None
60
 
@@ -98,7 +102,7 @@ iface = gr.Interface(
98
  gr.Plot(label="LO-wise Bar Chart"),
99
  gr.HTML(label="LO-wise Comparison Table")
100
  ],
101
- title="📘 Semantic Handout Comparator with LO Alignment (Fixed)",
102
  description="Compare course handouts and learning outcomes using robust PDF reading and transformers."
103
  )
104
 
 
53
  summary += "🆕 Significant changes detected."
54
 
55
  # LO comparison
56
+ if hasattr(lo_file, 'read'):
57
+ lo_text = lo_file.read().decode("utf-8", errors="ignore")
58
+ else:
59
+ lo_text = lo_file # already a string
60
+
61
+ los = [line.strip() for line in lo_text.splitlines() if line.strip()]
62
  if not los:
63
  return summary + "\n⚠️ No valid Learning Outcomes found.", None, None
64
 
 
102
  gr.Plot(label="LO-wise Bar Chart"),
103
  gr.HTML(label="LO-wise Comparison Table")
104
  ],
105
+ title="📘 Semantic Handout Comparator with LO Alignment (Final Patch)",
106
  description="Compare course handouts and learning outcomes using robust PDF reading and transformers."
107
  )
108