Skip to content

Commit

Permalink
Change default expert count to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kalomaze committed Dec 13, 2023
1 parent 94c1bb0 commit dd6a8db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2470,8 +2470,8 @@ static void llm_load_hparams(
ml.get_key (LLM_KV_BLOCK_COUNT, hparams.n_layer);
ml.get_key (LLM_KV_EXPERT_COUNT, hparams.n_expert, false);

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

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

0 comments on commit dd6a8db

Please sign in to comment.