Spaces:
Runtime error
Runtime error
File size: 268 Bytes
1d03d1e | 1 2 3 4 5 6 7 8 9 10 | 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()
|