fix: use file extension if filetype fails with PDF (#827)
Filetype library may not identify some files as PDF. Leverage the file extension as a simple solution. Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>
This commit is contained in:
parent
ba521dd88f
commit
adf6353483
@ -352,6 +352,8 @@ class _DocumentConversionInput(BaseModel):
|
|||||||
mime = FormatToMimeType[InputFormat.MD][0]
|
mime = FormatToMimeType[InputFormat.MD][0]
|
||||||
elif ext in FormatToExtensions[InputFormat.JSON_DOCLING]:
|
elif ext in FormatToExtensions[InputFormat.JSON_DOCLING]:
|
||||||
mime = FormatToMimeType[InputFormat.JSON_DOCLING][0]
|
mime = FormatToMimeType[InputFormat.JSON_DOCLING][0]
|
||||||
|
elif ext in FormatToExtensions[InputFormat.PDF]:
|
||||||
|
mime = FormatToMimeType[InputFormat.PDF][0]
|
||||||
return mime
|
return mime
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user