From 3cc242b5917fd037170f45cc0d1c7d5ef828e370 Mon Sep 17 00:00:00 2001 From: ParamdeepSinghShorthillsAI <142562266+ParamdeepSinghShorthillsAI@users.noreply.github.com> Date: Thu, 7 Sep 2023 02:20:21 +0530 Subject: [PATCH] Update rwkv.py import error (#10293) I have updated the code to ensure consistent error handling for ImportError. Instead of relying on ValueError as before, I've followed the standard practice of raising ImportError while also including detailed error messages. This modification improves code clarity and explicitly indicates that any issues are related to module imports. --- libs/langchain/langchain/llms/rwkv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/llms/rwkv.py b/libs/langchain/langchain/llms/rwkv.py index bb54c9d5deb..8072b2b91b6 100644 --- a/libs/langchain/langchain/llms/rwkv.py +++ b/libs/langchain/langchain/llms/rwkv.py @@ -121,7 +121,7 @@ class RWKV(LLM, BaseModel): values["pipeline"] = PIPELINE(values["client"], values["tokens_path"]) except ImportError: - raise ValueError( + raise ImportError( "Could not import rwkv python package. " "Please install it with `pip install rwkv`." )