You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/llm/io_processing/generation_config_builder.hpp
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -34,24 +34,21 @@ class GenerationConfigBuilder {
34
34
public:
35
35
GenerationConfigBuilder() = delete;
36
36
// Using tool parser name to select appropriate builder implementation to avoid introducing additional parameters. Might be insufficient in the future.
SPDLOG_LOGGER_DEBUG(llm_calculator_logger, "Option enable_tool_guided_generation is set, but will not be effective since no valid tool parser has been provided.");
SPDLOG_LOGGER_DEBUG(llm_calculator_logger, "Option enable_tool_guided_generation is set, but will not be effective since no valid tool parser has been provided.");
// TODO: check if we can rely on decoded <|python_tag|> token to be present in the content, so we can drop multiple detokenizations and copies
32
32
// and just extract substrings from the content and modify content in-place
33
33
34
-
// If immediate trigger parsing is enabled, we assume botTokenId has been injected into the prompt and whole output are tool calls,
35
-
// otherwise we search for botTokenId in the generatedTokens to find tool calls start or check if the content starts with "{" (llama3 sometimes does not generate botTokenId)
34
+
// We search for botTokenId in the generatedTokens to find tool calls start or check if the content starts with "{" (llama3 sometimes does not generate botTokenId)
36
35
auto toolCallsStartPosition = generatedTokens.begin();
37
-
if (!immediateParsingEnabled) {
38
-
toolCallsStartPosition = generatedTokens.end();
39
-
// Find botTokenId in generated_ids
40
-
auto botTokenIt = std::find(generatedTokens.begin(), generatedTokens.end(), botTokenId);
36
+
toolCallsStartPosition = generatedTokens.end();
37
+
// Find botTokenId in generated_ids
38
+
auto botTokenIt = std::find(generatedTokens.begin(), generatedTokens.end(), botTokenId);
0 commit comments