Skip to content

Commit d9ff418

Browse files
committed
debug
1 parent 3038569 commit d9ff418

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llama_cpp/llama_chat_template.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,11 @@ def _handle_streaming_tool_calls(
406406
accumulated_text = ""
407407
for chunk in completion_chunks:
408408
text = chunk["choices"][0]["text"]
409-
print("TEXT", text)
410409
accumulated_text += text
411410
stop_reason = chunk["choices"][0]["finish_reason"]
412411

413-
print("STOP REASON", stop_reason)
414-
415412
# Check if we hit a tool call
416413
if (stop_reason == "stop:<tool_call>"):
417-
print("TOOL CALL FOUND")
418414

419415
accumulated_text += "<tool_call>"
420416

@@ -439,7 +435,7 @@ def _handle_streaming_tool_calls(
439435
name_completion = llama.create_completion(
440436
prompt=combined_prompt,
441437
grammar=name_grammar,
442-
temperature=0,
438+
temperature=0.0,
443439
stream=False,
444440
stop=[], # Grammar will handle the format including colon
445441
**{k: v for k, v in base_completion_kwargs.items() if k != "stream" and k != "grammar"}
@@ -545,7 +541,6 @@ def _handle_streaming_tool_calls(
545541
}]
546542
}
547543
except Exception as e:
548-
print("ERROR", e)
549544
# Fall back to regular streaming without grammar
550545
fallback_prompt = prompt + llama.tokenize(accumulated_text.encode("utf-8"), add_bos=False, special=True)
551546
for chunk in llama.create_completion(

0 commit comments

Comments
 (0)