VibeLearning / convert.py
Kikolool's picture
Upload folder using huggingface_hub
1d03d1e verified
raw
history blame contribute delete
268 Bytes
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()