parent
e9fbe1b13b
commit
f1b04e8a1b
@ -28,7 +28,9 @@ class BaseResetProblemStep(IResetProblemStep):
|
|||||||
range(start_index if start_index > 0 else 0, len(history_chat_record))]
|
range(start_index if start_index > 0 else 0, len(history_chat_record))]
|
||||||
message_list = [*flat_map(history_message),
|
message_list = [*flat_map(history_message),
|
||||||
HumanMessage(content=prompt.format(**{'question': problem_text}))]
|
HumanMessage(content=prompt.format(**{'question': problem_text}))]
|
||||||
response = chat_model(message_list)
|
response = chat_model.invoke(message_list)
|
||||||
|
padding_problem = problem_text
|
||||||
|
if response.content.__contains__("<data>") and response.content.__contains__('</data>'):
|
||||||
padding_problem = response.content[response.content.index('<data>') + 6:response.content.index('</data>')]
|
padding_problem = response.content[response.content.index('<data>') + 6:response.content.index('</data>')]
|
||||||
self.context['message_tokens'] = chat_model.get_num_tokens_from_messages(message_list)
|
self.context['message_tokens'] = chat_model.get_num_tokens_from_messages(message_list)
|
||||||
self.context['answer_tokens'] = chat_model.get_num_tokens(padding_problem)
|
self.context['answer_tokens'] = chat_model.get_num_tokens(padding_problem)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user