parent
4eb46786a6
commit
b40790492c
@ -23,6 +23,8 @@ class BaseResetProblemStep(IResetProblemStep):
|
|||||||
def execute(self, problem_text: str, history_chat_record: List[ChatRecord] = None, chat_model: BaseChatModel = None,
|
def execute(self, problem_text: str, history_chat_record: List[ChatRecord] = None, chat_model: BaseChatModel = None,
|
||||||
**kwargs) -> str:
|
**kwargs) -> str:
|
||||||
if chat_model is None:
|
if chat_model is None:
|
||||||
|
self.context['message_tokens'] = 0
|
||||||
|
self.context['answer_tokens'] = 0
|
||||||
return problem_text
|
return problem_text
|
||||||
start_index = len(history_chat_record) - 3
|
start_index = len(history_chat_record) - 3
|
||||||
history_message = [[history_chat_record[index].get_human_message(), history_chat_record[index].get_ai_message()]
|
history_message = [[history_chat_record[index].get_human_message(), history_chat_record[index].get_ai_message()]
|
||||||
|
|||||||
@ -512,9 +512,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||||||
for update_key in update_keys:
|
for update_key in update_keys:
|
||||||
if update_key in instance and instance.get(update_key) is not None:
|
if update_key in instance and instance.get(update_key) is not None:
|
||||||
if update_key == 'multiple_rounds_dialogue':
|
if update_key == 'multiple_rounds_dialogue':
|
||||||
application.__setattr__('dialogue_number',
|
application.__setattr__('dialogue_number', 0 if not instance.get(update_key) else 3)
|
||||||
0 if not instance.get(update_key) else ModelProvideConstants[
|
|
||||||
model.provider].value.get_dialogue_number())
|
|
||||||
else:
|
else:
|
||||||
application.__setattr__(update_key, instance.get(update_key))
|
application.__setattr__(update_key, instance.get(update_key))
|
||||||
application.save()
|
application.save()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user