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
`# If we hit an error log it and keep trying
try:
res = converter.convert(local_path, **_kwargs)
except Exception:
error_trace = ("\n\n" + traceback.format_exc()).strip()
if res is not None:
# Normalize the content
res.text_content = "\n".join(
[line.rstrip() for line in re.split(r"\r?\n", res.text_content)]
)
res.text_content = re.sub(r"\n{3,}", "\n\n", res.text_content)
# Todo
return res`
I have a FastAPI application utilizing markitdown through the MarkItDown API. My endpoint receives a pdf file and should be processed by markitdown. Not sure where the exact problem really lies
UnboundLocalError Traceback (most recent call last)
in <cell line: 4>()
2
3 markitdown = MarkItDown()
----> 4 result = markitdown.convert("/content/TEST.pdf")
5 print(result.text_content)
2 frames
/usr/local/lib/python3.10/dist-packages/markitdown/_markitdown.py in _convert(self, local_path, extensions, **kwargs)
1043 error_trace = ("\n\n" + traceback.format_exc()).strip()
1044
-> 1045 if res is not None:
1046 # Normalize the content
1047 res.text_content = "\n".join(
UnboundLocalError: local variable 'res' referenced before assignment
The text was updated successfully, but these errors were encountered: