Remove unwanted libraries and lighten package (#1391)
This commit is contained in:
@@ -23,7 +23,7 @@ class AWSBedrockLlm(BaseLlm):
|
||||
except ModuleNotFoundError:
|
||||
raise ModuleNotFoundError(
|
||||
"The required dependencies for AWSBedrock are not installed."
|
||||
'Please install with `pip install --upgrade "embedchain[aws-bedrock]"`'
|
||||
"Please install with `pip install boto3==1.34.20`"
|
||||
) from None
|
||||
|
||||
self.boto_client = boto3.client("bedrock-runtime", "us-west-2" or os.environ.get("AWS_REGION"))
|
||||
@@ -38,8 +38,7 @@ class AWSBedrockLlm(BaseLlm):
|
||||
}
|
||||
|
||||
if config.stream:
|
||||
from langchain.callbacks.streaming_stdout import \
|
||||
StreamingStdOutCallbackHandler
|
||||
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
||||
|
||||
callbacks = [StreamingStdOutCallbackHandler()]
|
||||
llm = Bedrock(**kwargs, streaming=config.stream, callbacks=callbacks)
|
||||
|
||||
@@ -180,7 +180,7 @@ class BaseLlm(JSONSerializable):
|
||||
from langchain.tools import DuckDuckGoSearchRun
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
'Searching requires extra dependencies. Install with `pip install --upgrade "embedchain[dataloaders]"`'
|
||||
"Searching requires extra dependencies. Install with `pip install duckduckgo-search==6.1.5`"
|
||||
) from None
|
||||
search = DuckDuckGoSearchRun()
|
||||
logger.info(f"Access search to get answers for {input_query}")
|
||||
|
||||
@@ -24,7 +24,7 @@ class ClarifaiLlm(BaseLlm):
|
||||
except ModuleNotFoundError:
|
||||
raise ModuleNotFoundError(
|
||||
"The required dependencies for Clarifai are not installed."
|
||||
'Please install with `pip install --upgrade "embedchain[clarifai]"`'
|
||||
"Please install with `pip install clarifai==10.0.1`"
|
||||
) from None
|
||||
|
||||
model_name = config.model
|
||||
|
||||
@@ -22,7 +22,7 @@ class HuggingFaceLlm(BaseLlm):
|
||||
except ModuleNotFoundError:
|
||||
raise ModuleNotFoundError(
|
||||
"The required dependencies for HuggingFaceHub are not installed."
|
||||
'Please install with `pip install --upgrade "embedchain[huggingface-hub]"`'
|
||||
"Please install with `pip install huggingface-hub==0.23.0`"
|
||||
) from None
|
||||
|
||||
super().__init__(config=config)
|
||||
|
||||
Reference in New Issue
Block a user