-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate Falcon and Starcoder #530
Deprecate Falcon and Starcoder #530
Conversation
WalkthroughThis pull request introduces deprecation warnings for the Changes
TipsChat with CodeRabbit Bot (
|
80141f1
to
bfb039e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (2)
- pandasai/llm/falcon.py (1 hunks)
- pandasai/llm/starcoder.py (2 hunks)
Files skipped from review due to trivial changes (1)
- pandasai/llm/falcon.py
Additional comments (Suppressed): 3
pandasai/llm/starcoder.py (3)
11-14: The import of the
warnings
module is a new addition to this file. Ensure that it doesn't conflict with any other imports in the same namespace.31-38: Deprecation warning added for the
Starcoder
class. This is a significant change and users should be informed about this update in the documentation as well.40-42: No changes have been made to the
type
property of theStarcoder
class. It continues to return "starcoder" as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Files selected for processing (2)
- pandasai/llm/falcon.py (2 hunks)
- pandasai/llm/starcoder.py (2 hunks)
Additional comments (Suppressed): 4
pandasai/llm/falcon.py (3)
- 8-14: > Note: This review was outside of the patch, but no patch was found that overlapped with it. Original lines [17-14]
The import of the
warnings
module is a new addition to this file. Ensure that it's used appropriately throughout the codebase.
28-34: Deprecation warning added for the Falcon class. This is a good practice to inform users about deprecated features and suggest alternatives.
35-35: Good use of the
super()
function to call the parent's initializer while initializing the Falcon class.pandasai/llm/starcoder.py (1)
- 11-14: The import of
warnings
module is new and it's used correctly to issue a deprecation warning in theStarcoder
class. The rest of the imports remain unchanged.
|
||
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Starcoder
class has been updated with a deprecation warning in its __init__
method. This is a good practice when planning to remove or replace a feature in future releases. However, the api_token
attribute is still present but according to the PR summary, it should have been removed. Please verify this discrepancy.
- api_token: str
Also, ensure that all instances where Starcoder
is instantiated have been updated to handle the deprecation warning appropriately.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. @@ Coverage Diff @@
## main #530 +/- ##
==========================================
+ Coverage 87.07% 87.14% +0.07%
==========================================
Files 47 47
Lines 2019 2030 +11
==========================================
+ Hits 1758 1769 +11
Misses 261 261
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@mspronesti thanks a lot for the PR. I'd say let's wait a couple of weeks before updating the docs. For now I've just mentioned they are deprecated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gventuri,
as a result of this discussion #525, this PR aims at deprecating Falcon and Starcoder. Not sure we should update the docs yet.
Summary by CodeRabbit
Falcon
andStarcoder
classes in thepandasai/llm
module. Users are advised to use thelangchain.llms.HuggingFaceHub
class instead for future projects.docs/API/llms.md
) to reflect these deprecations and provide guidance on the recommended alternatives.