Minor: mark command line flags as required

PiperOrigin-RevId: 757775369
This commit is contained in:
Jan Wassenberg 2025-05-12 08:30:04 -07:00 committed by Copybara-Service
parent 252a4e955e
commit cf7dd80c17
2 changed files with 4 additions and 26 deletions

View File

@ -263,14 +263,6 @@ TEST_F(GemmaTest, CrossEntropySmall) {
float entropy = s_env->CrossEntropy(kSmall);
fprintf(stderr, "per-token entropy: %f\n", entropy);
switch (config.model) {
case gcpp::Model::GEMMA_2B:
// 2B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 2.6f, 0.2f);
break;
case gcpp::Model::GEMMA_7B:
// 7B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 2.8f, 0.2f);
break;
case gcpp::Model::GRIFFIN_2B:
EXPECT_NEAR(entropy, 2.61f, 0.02f);
break;
@ -295,14 +287,6 @@ TEST_F(GemmaTest, CrossEntropyJingleBells) {
float entropy = s_env->CrossEntropy(kJingleBells);
fprintf(stderr, "per-token entropy: %f\n", entropy);
switch (config.model) {
case gcpp::Model::GEMMA_2B:
// 2B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 1.9f, 0.2f);
break;
case gcpp::Model::GEMMA_7B:
// 7B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 1.07f, 0.05f);
break;
case gcpp::Model::GRIFFIN_2B:
EXPECT_NEAR(entropy, 1.62f, 0.02f);
break;
@ -327,14 +311,6 @@ TEST_F(GemmaTest, CrossEntropyGettysburg) {
float entropy = s_env->CrossEntropy(kGettysburg);
fprintf(stderr, "per-token entropy: %f\n", entropy);
switch (config.model) {
case gcpp::Model::GEMMA_2B:
// 2B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 1.1f, 0.1f);
break;
case gcpp::Model::GEMMA_7B:
// 7B v.1 and v.1.1 produce slightly different results.
EXPECT_NEAR(entropy, 0.75f, 0.1f);
break;
case gcpp::Model::GRIFFIN_2B:
EXPECT_NEAR(entropy, 0.71f, 0.02f);
break;

View File

@ -520,14 +520,16 @@ def export_paligemma_sbs(
_MODEL_SPECIFIER = flags.DEFINE_string(
"model_specifier",
"",
None,
"String specifying model, size, weight, wrapping (ModelConfig.Specifier)",
required=True,
)
_LOAD_PATH = flags.DEFINE_string(
"load_path",
"",
None,
"Path to the safetensors index.json file to read",
required=True,
)
_TOKENIZER_FILE = flags.DEFINE_string(
"tokenizer_file",