mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-23 04:12:13 +00:00
fix: Code standards (#1393)
This commit is contained in:
parent
4fe10c0906
commit
0f2b46da62
@ -127,8 +127,8 @@ class BaseOutputParser(MapOperator[ModelOutput, Any], ABC):
|
||||
ai_response = ai_response.replace("assistant:", "")
|
||||
ai_response = ai_response.replace("Assistant:", "")
|
||||
ai_response = ai_response.replace("ASSISTANT:", "")
|
||||
ai_response = ai_response.replace("\_", "_")
|
||||
ai_response = ai_response.replace("\*", "*")
|
||||
ai_response = ai_response.replace("\\_", "_")
|
||||
ai_response = ai_response.replace("\\*", "*")
|
||||
ai_response = ai_response.replace("\t", "")
|
||||
|
||||
# ai_response = ai_response.strip().replace("\\n", " ").replace("\n", " ")
|
||||
@ -234,7 +234,7 @@ class BaseOutputParser(MapOperator[ModelOutput, Any], ABC):
|
||||
.replace("\\n", " ")
|
||||
.replace("\n", " ")
|
||||
.replace("\\", " ")
|
||||
.replace("\_", "_")
|
||||
.replace("\\_", "_")
|
||||
)
|
||||
cleaned_output = self._illegal_json_ends(cleaned_output)
|
||||
return cleaned_output
|
||||
|
@ -363,7 +363,7 @@ class LlamaCppAdapater(BaseLLMAdaper):
|
||||
logger.warn(
|
||||
f"Model path {model_path} is not single file, use first *gglm*.gguf model file: {model_path}"
|
||||
)
|
||||
if not re.fullmatch(".*ggml.*\.gguf", model_path):
|
||||
if not re.fullmatch(r".*ggml.*\.gguf", model_path):
|
||||
return False, None
|
||||
return True, model_path
|
||||
|
||||
|
@ -5,6 +5,7 @@ from pydantic import Field
|
||||
from dbgpt._private.config import Config
|
||||
from dbgpt.agent.agents.base_agent_new import ConversableAgent
|
||||
from dbgpt.agent.resource.resource_api import AgentResource
|
||||
|
||||
from .plan_action import PlanAction
|
||||
|
||||
CFG = Config()
|
||||
@ -80,7 +81,10 @@ class PlannerAgent(ConversableAgent):
|
||||
for agent in self.agents:
|
||||
if agent.resources and len(agent.resources) > 0:
|
||||
for resource in agent.resources:
|
||||
if self.get_unique_resources_codes(resource) not in unique_resources:
|
||||
if (
|
||||
self.get_unique_resources_codes(resource)
|
||||
not in unique_resources
|
||||
):
|
||||
unique_resources.add(self.get_unique_resources_codes(resource))
|
||||
self.resources.append(resource)
|
||||
return self
|
||||
|
@ -189,7 +189,7 @@ def get_cpu_info():
|
||||
match = re.search(r".*Model name:\s*(.+)", output)
|
||||
if match:
|
||||
cpu_info = match.group(1).strip()
|
||||
match = re.search(f".*型号名称:\s*(.+)", output)
|
||||
match = re.search(r".*型号名称:\s*(.+)", output)
|
||||
if match:
|
||||
cpu_info = match.group(1).strip()
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user