multi-turn tool call test

This commit is contained in:
Hardik Shah 2025-04-05 20:26:22 -07:00
parent 3021c87271
commit eafbde4e17
2 changed files with 60 additions and 0 deletions

View file

@ -338,6 +338,10 @@ class MetaReferenceInferenceImpl(
stop_reason = None
for token_result in self.generator.chat_completion(request):
from termcolor import cprint
cprint(token_result.text, "cyan", end="")
tokens.append(token_result.token)
if token_result.token == tokenizer.eot_id:
@ -386,6 +390,10 @@ class MetaReferenceInferenceImpl(
ipython = False
for token_result in self.generator.chat_completion(request):
from termcolor import cprint
cprint(token_result.text, "cyan", end="")
tokens.append(token_result.token)
if not ipython and token_result.text.startswith("<|python_tag|>"):