Skip to content

Commit dd6a8db

Browse files
committed
Change default expert count to 2
1 parent 94c1bb0 commit dd6a8db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llama.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2470,8 +2470,8 @@ static void llm_load_hparams(
24702470
ml.get_key (LLM_KV_BLOCK_COUNT, hparams.n_layer);
24712471
ml.get_key (LLM_KV_EXPERT_COUNT, hparams.n_expert, false);
24722472

2473-
// Declare the custom expert used count variable and initialize it to 1
2474-
int CUSTOM_EXPERT_USED_COUNT = 1;
2473+
// Declare the custom expert used count variable and initialize it to 2
2474+
int CUSTOM_EXPERT_USED_COUNT = 2;
24752475
std::string filename = "experts.txt";
24762476

24772477
// Try to open the file for reading
@@ -2481,14 +2481,14 @@ static void llm_load_hparams(
24812481
if (!(infile >> CUSTOM_EXPERT_USED_COUNT)) {
24822482
// If reading fails, set CUSTOM_EXPERT_USED_COUNT to an error value or handle the error as needed
24832483
printf("Error reading from file: %s\n", filename.c_str());
2484-
CUSTOM_EXPERT_USED_COUNT = 1; // Default value or error value
2484+
CUSTOM_EXPERT_USED_COUNT = 2; // Default value
24852485
}
24862486
infile.close(); // Close the file after reading or failing to read
24872487
} else {
24882488
// The file doesn't exist or couldn't be opened for reading. Try creating it.
24892489
std::ofstream outfile(filename);
24902490
if (outfile.is_open()) {
2491-
outfile << CUSTOM_EXPERT_USED_COUNT; // Write 1 to the file
2491+
outfile << CUSTOM_EXPERT_USED_COUNT; // Write 2 to the file
24922492
outfile.close(); // Close the file after writing
24932493
} else {
24942494
// If the file couldn't be opened for writing, print an error message

0 commit comments

Comments
 (0)