Spaces:
Sleeping
Sleeping
Update working_yolo_pipeline.py
Browse files- working_yolo_pipeline.py +2 -2
working_yolo_pipeline.py
CHANGED
|
@@ -172,7 +172,7 @@ def get_latex_from_base64(base64_string: str) -> str:
|
|
| 172 |
# B. CRITICAL FIX: Replace double backslashes (\\) with single backslashes (\).
|
| 173 |
# This corrects model output that already over-escaped the LaTeX commands.
|
| 174 |
# Python literal: '\\\\' is replaced with '\\'.
|
| 175 |
-
cleaned_latex = cleaned_latex.replace('\\\\', '\\')
|
| 176 |
|
| 177 |
return cleaned_latex
|
| 178 |
|
|
@@ -2596,7 +2596,7 @@ if __name__ == "__main__":
|
|
| 2596 |
# 2. **AGGRESSIVE UNDO ESCAPING:** We assume we have quadruple backslashes and
|
| 2597 |
# replace them with the double backslashes needed for the LaTeX command to work.
|
| 2598 |
# This operation essentially replaces four literal backslashes with two literal backslashes.
|
| 2599 |
-
final_output_content = json_str.replace('\\\\\\\\', '\\\\')
|
| 2600 |
|
| 2601 |
# 3. Write the corrected string content to the file.
|
| 2602 |
with open(final_output_path, 'w', encoding='utf-8') as f:
|
|
|
|
| 172 |
# B. CRITICAL FIX: Replace double backslashes (\\) with single backslashes (\).
|
| 173 |
# This corrects model output that already over-escaped the LaTeX commands.
|
| 174 |
# Python literal: '\\\\' is replaced with '\\'.
|
| 175 |
+
#cleaned_latex = cleaned_latex.replace('\\\\', '\\')
|
| 176 |
|
| 177 |
return cleaned_latex
|
| 178 |
|
|
|
|
| 2596 |
# 2. **AGGRESSIVE UNDO ESCAPING:** We assume we have quadruple backslashes and
|
| 2597 |
# replace them with the double backslashes needed for the LaTeX command to work.
|
| 2598 |
# This operation essentially replaces four literal backslashes with two literal backslashes.
|
| 2599 |
+
# final_output_content = json_str.replace('\\\\\\\\', '\\\\')
|
| 2600 |
|
| 2601 |
# 3. Write the corrected string content to the file.
|
| 2602 |
with open(final_output_path, 'w', encoding='utf-8') as f:
|