Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -661,7 +661,7 @@ Return only valid JSON. Do not include explanation, markdown, or comments.
|
|
| 661 |
|
| 662 |
# 🔧 Sanitize malformed lines
|
| 663 |
if not isinstance(clean_line, str) or len(clean_line.strip()) == 0 or clean_line.strip().startswith('"') or "{" in clean_line:
|
| 664 |
-
|
| 665 |
# Try to recover from JSON-like noise
|
| 666 |
candidates = re.findall(r'\"line\"\s*:\s*\"([^\"]+)\"', clean_line)
|
| 667 |
if candidates:
|
|
|
|
| 661 |
|
| 662 |
# 🔧 Sanitize malformed lines
|
| 663 |
if not isinstance(clean_line, str) or len(clean_line.strip()) == 0 or clean_line.strip().startswith('"') or "{" in clean_line:
|
| 664 |
+
add_log(f"⚠️ Malformed line detected for speaker {item['speaker']}: {repr(clean_line[:80])}")
|
| 665 |
# Try to recover from JSON-like noise
|
| 666 |
candidates = re.findall(r'\"line\"\s*:\s*\"([^\"]+)\"', clean_line)
|
| 667 |
if candidates:
|