refined tool use
This commit is contained in:
8
llama.py
8
llama.py
@@ -3,6 +3,7 @@ import random
|
||||
from tool_helper import tool_list, parse_and_execute_tool_call
|
||||
from tool_functions import register_dummy
|
||||
from inference import Inference, torch_reseed
|
||||
import datetime
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +64,8 @@ def main():
|
||||
|
||||
inference = Inference()
|
||||
|
||||
messages = [{"role": "system", "content": systemmessage + "\n" + inference.generate_tool_use_header(tool_list)}]
|
||||
current_date_and_time = datetime.datetime.now().strftime("Current date is %Y-%m-%d and its %H:%M %p right now.")
|
||||
messages = [{"role": "system", "content": systemmessage + "\n" + current_date_and_time + "\n" + inference.generate_tool_use_header(tool_list)}]
|
||||
|
||||
while True:
|
||||
# print an input prompt to receive text or commands
|
||||
@@ -72,8 +74,8 @@ def main():
|
||||
|
||||
|
||||
if input_text.startswith("!"):
|
||||
# append_generate_chat("<tool_response>%s</tool_response>" % input_text[1:], role="tool")
|
||||
append_generate_chat("%s" % input_text[1:], role="tool") # depending on the chat template the tool response tags must or must not be passed. :(
|
||||
append_generate_chat("<tool_response>%s</tool_response>" % input_text[1:], role="tool")
|
||||
# append_generate_chat("%s" % input_text[1:], role="tool") # depending on the chat template the tool response tags must or must not be passed. :(
|
||||
|
||||
elif input_text.startswith("/clear"):
|
||||
print("clearing chat history")
|
||||
|
Reference in New Issue
Block a user