Spaces:
Runtime error
Runtime error
| import re | |
| from fastapi import File, UploadFile | |
| from markitdown import MarkItDown | |
| def clean_json_string(json_string): | |
| pattern = r"^```json\s*(.*?)\s*```$" | |
| cleaned_string = re.sub(pattern, r"\1", json_string, flags=re.DOTALL) | |
| return cleaned_string.strip() | |