diff --git a/docs/API/llms.md b/docs/API/llms.md index 5983dfe51..e05f5c5c0 100644 --- a/docs/API/llms.md +++ b/docs/API/llms.md @@ -18,18 +18,22 @@ OpenAI API wrapper extended through BaseOpenAI class. options: show_root_heading: true -### Starcoder +### Starcoder (deprecated) Starcoder wrapper extended through Base HuggingFace Class +- Note: Starcoder is deprecated and will be removed in future versions. Please use another LLM. + ::: pandasai.llm.starcoder options: show_root_heading: true -### Falcon +### Falcon (deprecated) Falcon wrapper extended through Base HuggingFace Class +- Note: Falcon is deprecated and will be removed in future versions. Please use another LLM. + ::: pandasai.llm.falcon options: show_root_heading: true diff --git a/pandasai/llm/falcon.py b/pandasai/llm/falcon.py index 9fabd01c3..e722f4663 100644 --- a/pandasai/llm/falcon.py +++ b/pandasai/llm/falcon.py @@ -8,7 +8,7 @@ >>> from pandasai.llm.falcon import Falcon """ - +import warnings from ..helpers import load_dotenv from .base import HuggingFaceLLM @@ -17,12 +17,7 @@ class Falcon(HuggingFaceLLM): - - """Falcon LLM API - - A base HuggingFaceLLM class is extended to use Falcon model. - - """ + """Falcon LLM API (Deprecated: Kept for backwards compatibility)""" api_token: str _api_url: str = ( @@ -30,6 +25,15 @@ class Falcon(HuggingFaceLLM): ) _max_retries: int = 30 + def __init__(self, **kwargs): + warnings.warn( + """Falcon is deprecated and will be removed in a future release. + Please use langchain.llms.HuggingFaceHub instead, although please be + aware that it may perform poorly. + """ + ) + super().__init__(**kwargs) + @property def type(self) -> str: return "falcon" diff --git a/pandasai/llm/starcoder.py b/pandasai/llm/starcoder.py index 3546116c1..c84d227b6 100644 --- a/pandasai/llm/starcoder.py +++ b/pandasai/llm/starcoder.py @@ -8,7 +8,7 @@ >>> from pandasai.llm.starcoder import Starcoder """ - +import warnings from ..helpers import load_dotenv from .base import HuggingFaceLLM @@ -18,16 +18,21 @@ class Starcoder(HuggingFaceLLM): - """Starcoder LLM API - - A base HuggingFaceLLM class is extended to use Starcoder model. - - """ + """Starcoder LLM API (Deprecated: Kept for backwards compatibility)""" api_token: str _api_url: str = "https://api-inference.huggingface.co/models/bigcode/starcoder" _max_retries: int = 30 + def __init__(self, **kwargs): + warnings.warn( + """Starcoder is deprecated and will be removed in a future release. + Please use langchain.llms.HuggingFaceHub instead, although please be + aware that it may perform poorly. + """ + ) + super().__init__(**kwargs) + @property def type(self) -> str: return "starcoder"