Commit 814bd4ea authored by myhloli's avatar myhloli
Browse files

fix(dataset): correct variable for language detection

- Change `bits` to `self._data_bits` for language detection
- This fixes the TypeError when opening PDF files
parent 4afdba36
...@@ -249,7 +249,7 @@ class ImageDataset(Dataset): ...@@ -249,7 +249,7 @@ class ImageDataset(Dataset):
elif lang == 'auto': elif lang == 'auto':
from magic_pdf.model.sub_modules.language_detection.utils import \ from magic_pdf.model.sub_modules.language_detection.utils import \
auto_detect_lang auto_detect_lang
self._lang = auto_detect_lang(bits) self._lang = auto_detect_lang(self._data_bits)
logger.info(f'lang: {lang}, detect_lang: {self._lang}') logger.info(f'lang: {lang}, detect_lang: {self._lang}')
else: else:
self._lang = lang self._lang = lang
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment