Skip to content

Commit

Permalink
feat(llm): deprecate falcon and starcoder
Browse files Browse the repository at this point in the history
  • Loading branch information
mspronesti committed Sep 5, 2023
1 parent c986050 commit 80141f1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
17 changes: 11 additions & 6 deletions pandasai/llm/falcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,29 @@

from ..helpers import load_dotenv
from .base import HuggingFaceLLM
import warnings

load_dotenv()


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 = (
"https://api-inference.huggingface.co/models/tiiuae/falcon-7b-instruct"
)
_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"
11 changes: 10 additions & 1 deletion pandasai/llm/starcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>>> from pandasai.llm.starcoder import Starcoder
"""

import warnings

from ..helpers import load_dotenv
from .base import HuggingFaceLLM
Expand All @@ -28,6 +28,15 @@ class Starcoder(HuggingFaceLLM):
_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"

0 comments on commit 80141f1

Please sign in to comment.