Skip to content
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

fix(pandasai.json): remove llm configs from pandasi json file #1504

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pandasai.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
"open_charts": true,
"save_charts": false,
"save_charts_path": "exports/charts",
"custom_whitelisted_dependencies": [],
"llm": "BambooLLM",
"llm_options": null
"custom_whitelisted_dependencies": []
}
7 changes: 2 additions & 5 deletions pandasai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ def load_config_from_json(
with open(find_closest("pandasai.json"), "r") as f:
config = json.load(f)

# if config is a dict
if config.get("llm") and not override_config.get("llm"):
options = config.get("llm_options") or {}
config["llm"] = getattr(llm, config["llm"])(**options)
elif not config.get("llm") and not override_config.get("llm"):
if not config.get("llm") and not override_config.get("llm"):
config["llm"] = llm.BambooLLM()

except FileNotFoundError:
# Ignore the error if the file does not exist, will use the default config
pass
Expand Down
2 changes: 2 additions & 0 deletions pandasai/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .huggingface_text_gen import HuggingFaceTextGen
from .ibm_watsonx import IBMwatsonx
from .langchain import LangchainLLM
from .local_llm import LocalLLM
from .openai import OpenAI

__all__ = [
Expand All @@ -22,4 +23,5 @@
"LangchainLLM",
"BedrockClaude",
"IBMwatsonx",
"LocalLLM",
]
Loading