Просмотр исходного кода

Refactor:naive_merge_with_images close useless images (#9296)

### What problem does this PR solve?

naive_merge_with_images close useless images

### Type of change

- [x] Refactoring
tags/v0.20.1
Stephen Hu 2 месяцев назад
Родитель
Сommit
0a0bfc02a0
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 4 добавлений и 0 удалений
  1. 4
    0
      rag/nlp/__init__.py

+ 4
- 0
rag/nlp/__init__.py Просмотреть файл

@@ -611,6 +611,10 @@ def naive_merge_with_images(texts, images, chunk_token_num=128, delimiter="\n。
if re.match(f"^{dels}$", sub_sec):
continue
add_chunk(sub_sec, image)
for img in images:
if isinstance(img, Image.Image):
img.close()

return cks, result_images


Загрузка…
Отмена
Сохранить