akhaliq HF Staff commited on
Commit
a35ce25
·
1 Parent(s): e8140e4
Files changed (1) hide show
  1. backend_api.py +5 -0
backend_api.py CHANGED
@@ -520,6 +520,11 @@ def cleanup_generated_code(code: str, language: str) -> str:
520
  try:
521
  original_code = code
522
 
 
 
 
 
 
523
  # Special handling for ComfyUI JSON
524
  if language == "comfyui":
525
  # Try to parse as JSON first
 
520
  try:
521
  original_code = code
522
 
523
+ # Special handling for transformers.js - preserve === markers
524
+ if language == "transformers.js":
525
+ # Don't clean transformers.js code - it needs the === markers
526
+ return code
527
+
528
  # Special handling for ComfyUI JSON
529
  if language == "comfyui":
530
  # Try to parse as JSON first