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