Skip to content

Commit

Permalink
Merge branch '0.6_dev_tc' of github.com:OpenSPG/KAG into 0.6_dev_tc
Browse files Browse the repository at this point in the history
  • Loading branch information
caszkgui committed Dec 27, 2024
2 parents 63a48bb + b624233 commit 26fdbc0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion kag/common/llm/llm_config_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def check(self, config: str) -> str:
llm_client = LLMClient.from_config(config)
try:
res = llm_client("who are you?")
print(res)
return res
except Exception as ex:
raise RuntimeError(f"invalid llm config: {config}, for details: {ex}")
Expand Down
4 changes: 1 addition & 3 deletions kag/common/registry/registrable.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,7 @@ def from_config(
logger.warn(f"Failed to initialize class {cls}, info: {e}")
raise e
if len(params) > 0:
raise ConfigurationError(
f"These params are not used for constructing {cls}:\n{params}"
)
logger.warn(f"These params are not used for constructing {cls}:\n{params}")

return instant

Expand Down
1 change: 0 additions & 1 deletion kag/solver/plan/default_lf_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def _parse_lf(self, question, sub_querys, logic_forms) -> List[LFPlan]:
sub_querys = []
# process sub query
sub_querys = [ self._process_output_query(question, q) for q in sub_querys]

parsed_logic_nodes = self.parser.parse_logic_form_set(
logic_forms, sub_querys, question
)
Expand Down
7 changes: 4 additions & 3 deletions knext/command/sub_command/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied.
import kag_ant
from collections import OrderedDict
import re
import json
Expand Down Expand Up @@ -216,11 +217,11 @@ def update_project(proj_path):
llm_config_checker = LLMConfigChecker()
vectorize_model_config_checker = VectorizeModelConfigChecker()
llm_config = env.config.get("chat_llm", {})
vectorize_model_config = env.config.get("vectorize_model", {})
vectorize_model_config = env.config.get("vectorizer", {})
try:
llm_config_checker.check(json.dumps(llm_config))
print(json.dumps(llm_config))
vectorize_model_config_checker.check(json.dumps(vectorize_model_config))
dim = vectorize_model_config_checker.check(json.dumps(vectorize_model_config))
env.config["vectorizer"]["vector_dimensions"] = dim
except Exception as e:
click.secho(f"Error: {e}", fg="bright_red")
sys.exit()
Expand Down

0 comments on commit 26fdbc0

Please sign in to comment.