Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix log
  • Loading branch information
timothycarambat committed Jun 7, 2025
commit 5c2baab675f73f6e645bfb1279ea7e3b6eb45b36
19 changes: 9 additions & 10 deletions server/utils/AiProviders/modelMap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class ContextWindowFinder {
ContextWindowFinder.instance = this;
if (!fs.existsSync(this.cacheLocation))
fs.mkdirSync(this.cacheLocation, { recursive: true });

// If the cache is stale or not found at all, pull the model map from remote
if (this.isCacheStale || !fs.existsSync(this.cacheFilePath))
this.#pullRemoteModelMap();
}
Expand Down Expand Up @@ -64,16 +66,13 @@ class ContextWindowFinder {
*/
get cachedModelMap() {
if (!fs.existsSync(this.cacheFilePath)) {
this.log("--------------------------------");
this.log("[WARNING] Model map cache is not found!");
this.log(
"Invalid context windows will be returned leading to inaccurate model responses"
);
this.log("or smaller context windows than expected.");
this.log(
"You can fix this by restarting AnythingLLM so the model map is re-pulled."
);
this.log("--------------------------------");
this.log(`\x1b[33m
--------------------------------
[WARNING] Model map cache is not found!
Invalid context windows will be returned leading to inaccurate model responses
or smaller context windows than expected.
You can fix this by restarting AnythingLLM so the model map is re-pulled.
--------------------------------\x1b[0m`);
return null;
}

Expand Down