From 51df00729efe8bb4e62a1bb6dea1978b49ec39a0 Mon Sep 17 00:00:00 2001 From: Taranjeet Singh Date: Fri, 17 Nov 2023 18:19:08 -0800 Subject: [PATCH] Import beautifulsoup pacakge lazily. (#964) --- embedchain/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embedchain/utils.py b/embedchain/utils.py index 21a55e79..e51bcebd 100644 --- a/embedchain/utils.py +++ b/embedchain/utils.py @@ -5,7 +5,6 @@ import re import string from typing import Any -from bs4 import BeautifulSoup from schema import Optional, Or, Schema from embedchain.models.data_type import DataType @@ -16,6 +15,8 @@ def parse_content(content, type): if type not in implemented: raise ValueError(f"Parser type {type} not implemented. Please choose one of {implemented}") + from bs4 import BeautifulSoup + soup = BeautifulSoup(content, type) original_size = len(str(soup.get_text()))