akhaliq HF Staff commited on
Commit
931474d
·
1 Parent(s): ccf0e98
Files changed (1) hide show
  1. backend_parsers.py +2 -0
backend_parsers.py CHANGED
@@ -18,6 +18,8 @@ def parse_transformers_js_output(code: str) -> Dict[str, str]:
18
  print(f"[Parser] Received code length: {len(code)} characters")
19
  print(f"[Parser] First 200 chars: {code[:200]}")
20
 
 
 
21
  # Check if code starts with HTML instead of markers (common LLM mistake)
22
  if code_stripped.startswith('<!DOCTYPE') or code_stripped.startswith('<html'):
23
  print("[Parser] WARNING: Code starts with HTML instead of === index.html === marker")
 
18
  print(f"[Parser] Received code length: {len(code)} characters")
19
  print(f"[Parser] First 200 chars: {code[:200]}")
20
 
21
+ code_stripped = code.strip()
22
+
23
  # Check if code starts with HTML instead of markers (common LLM mistake)
24
  if code_stripped.startswith('<!DOCTYPE') or code_stripped.startswith('<html'):
25
  print("[Parser] WARNING: Code starts with HTML instead of === index.html === marker")