From 7cdb0d38741e2b1da97499e018268b6ce01b63a2 Mon Sep 17 00:00:00 2001 From: Phil Culliton Date: Fri, 28 Feb 2025 16:04:54 -0800 Subject: [PATCH] Internal change. PiperOrigin-RevId: 732288967 --- compression/shared.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compression/shared.h b/compression/shared.h index a947fee2..29b07cc9 100644 --- a/compression/shared.h +++ b/compression/shared.h @@ -186,11 +186,16 @@ constexpr bool IsNuqStream() { } // Instruction-tuned models require extra 'turn structure' tokens in prompts. -enum class PromptWrapping { GEMMA_IT, GEMMA_PT, PALIGEMMA }; +enum class PromptWrapping { + GEMMA_IT, + GEMMA_PT, + PALIGEMMA, + kSentinel // must be last +}; inline bool EnumValid(PromptWrapping type) { return static_cast(type) >= 0 && - static_cast(type) <= static_cast(PromptWrapping::PALIGEMMA); + static_cast(type) < static_cast(PromptWrapping::kSentinel); } // Tensor types for loading weights. Note that not all types are supported as