You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DocToolsLLM/utils/loaders.py
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,7 @@
90
90
clozeregex=re.compile(r"{{c\d+::|}}") # for removing clozes in anki
91
91
markdownlink_regex=re.compile(r"\[.*?\]\((.*?)\)") # to find markdown links
92
92
markdownlinkparser_regex=re.compile(r'\[([^\]]+)\]\(http[s]?://[^)]+\)') # to replace markdown links by their text
93
+
markdownimage_regex=re.compile(r'!\[([^\]]*)\]\s*(\([^\)]+\)|\[[^\]]+\])') # to remove image from jina reader that take a lot of tokens but are not yet used
text=markdownimage_regex.sub(" ", text, flags=re.MULTILINE) # remove markdown images for now as caption is disabled so it's just base64 or something like that
0 commit comments