mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 03:46:52 +08:00
fix: change model mode. (#1520)
This commit is contained in:
@@ -277,7 +277,6 @@ class Completion:
|
|||||||
if app_model_config.prompt_type == 'simple':
|
if app_model_config.prompt_type == 'simple':
|
||||||
prompt_messages, stop_words = prompt_transform.get_prompt(
|
prompt_messages, stop_words = prompt_transform.get_prompt(
|
||||||
app_mode=mode,
|
app_mode=mode,
|
||||||
app_model_config=app_model_config,
|
|
||||||
pre_prompt=app_model_config.pre_prompt,
|
pre_prompt=app_model_config.pre_prompt,
|
||||||
inputs=inputs,
|
inputs=inputs,
|
||||||
query=query,
|
query=query,
|
||||||
@@ -366,7 +365,6 @@ class Completion:
|
|||||||
if app_model_config.prompt_type == 'simple':
|
if app_model_config.prompt_type == 'simple':
|
||||||
prompt_messages, _ = prompt_transform.get_prompt(
|
prompt_messages, _ = prompt_transform.get_prompt(
|
||||||
app_mode=mode,
|
app_mode=mode,
|
||||||
app_model_config=app_model_config,
|
|
||||||
pre_prompt=app_model_config.pre_prompt,
|
pre_prompt=app_model_config.pre_prompt,
|
||||||
inputs=inputs,
|
inputs=inputs,
|
||||||
query=query,
|
query=query,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ class AppMode(enum.Enum):
|
|||||||
class PromptTransform:
|
class PromptTransform:
|
||||||
def get_prompt(self,
|
def get_prompt(self,
|
||||||
app_mode: str,
|
app_mode: str,
|
||||||
app_model_config: AppModelConfig,
|
|
||||||
pre_prompt: str,
|
pre_prompt: str,
|
||||||
inputs: dict,
|
inputs: dict,
|
||||||
query: str,
|
query: str,
|
||||||
@@ -36,10 +35,9 @@ class PromptTransform:
|
|||||||
memory: Optional[BaseChatMemory],
|
memory: Optional[BaseChatMemory],
|
||||||
model_instance: BaseLLM) -> \
|
model_instance: BaseLLM) -> \
|
||||||
Tuple[List[PromptMessage], Optional[List[str]]]:
|
Tuple[List[PromptMessage], Optional[List[str]]]:
|
||||||
model_mode = app_model_config.model_dict['mode']
|
|
||||||
|
|
||||||
app_mode_enum = AppMode(app_mode)
|
app_mode_enum = AppMode(app_mode)
|
||||||
model_mode_enum = ModelMode(model_mode)
|
model_mode_enum = model_instance.model_mode
|
||||||
|
|
||||||
prompt_rules = self._read_prompt_rules_from_file(self._prompt_file_name(app_mode, model_instance))
|
prompt_rules = self._read_prompt_rules_from_file(self._prompt_file_name(app_mode, model_instance))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user