Skip to content

Commit

Permalink
fix temperature bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyizi committed Nov 9, 2024
1 parent 77f9387 commit c4f78a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,6 @@ TONGYI_PROXY_API_KEY={your-tongyi-sk}
# Xunfei Spark
#XUNFEI_SPARK_API_PASSWORD={your_api_password}
#XUNFEI_SPARK_API_MODEL={version}
#XUNFEI_SPARK_APPID={your_app_id}
#XUNFEI_SPARK_API_KEY={your_api_key}
#XUNFEI_SPARK_API_SECRET={your_api_secret}

## Yi Proxyllm, https://platform.lingyiwanwu.com/docs
#YI_MODEL_VERSION=yi-34b-chat-0205
Expand Down
17 changes: 6 additions & 11 deletions dbgpt/_private/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,12 @@ def __init__(self) -> None:
)

# xunfei spark
self.spark_api_version = os.getenv("XUNFEI_SPARK_API_VERSION")
self.spark_proxy_api_key = os.getenv("XUNFEI_SPARK_API_KEY")
self.spark_proxy_api_secret = os.getenv("XUNFEI_SPARK_API_SECRET")
self.spark_proxy_api_appid = os.getenv("XUNFEI_SPARK_APPID")
if self.spark_proxy_api_key and self.spark_proxy_api_secret:
os.environ["spark_proxyllm_proxy_api_key"] = self.spark_proxy_api_key
os.environ["spark_proxyllm_proxy_api_secret"] = self.spark_proxy_api_secret
os.environ["spark_proxyllm_proxyllm_backend"] = self.spark_api_version or ""
os.environ["spark_proxyllm_proxy_api_app_id"] = (
self.spark_proxy_api_appid or ""
)
self.spark_proxy_api_password = os.getenv("XUNFEI_SPARK_API_PASSWORD")
self.spark_proxy_api_model = os.getenv("XUNFEI_SPARK_API_MODEL")
if self.spark_proxy_api_model and self.spark_proxy_api_password:
os.environ["spark_proxyllm_proxy_api_password"] = self.spark_proxy_api_password
os.environ["spark_proxyllm_proxy_api_model"] = self.spark_proxy_api_model


# baichuan proxy
self.bc_proxy_api_key = os.getenv("BAICHUAN_PROXY_API_KEY")
Expand Down
2 changes: 1 addition & 1 deletion dbgpt/app/scene/base_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async def _build_model_request(self) -> ModelRequest:
)
node = AppChatComposerOperator(
model=self.llm_model,
temperature=float(self.prompt_template.temperature),
temperature=self._chat_param.get("temperature") or float(self.prompt_template.temperature),
max_new_tokens=int(self.prompt_template.max_new_tokens),
prompt=self.prompt_template.prompt,
message_version=self._message_version,
Expand Down

0 comments on commit c4f78a1

Please sign in to comment.