Skip to content

Commit 3604e36

Browse files
fix: compare raw float for mmproj size check, not rounded string
Per Gemini review - toFixed(1) rounding could mask the warning for files very close to 100MB. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5833a55 commit 3604e36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/llm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ class LLMService {
114114
async initializeMultimodal(mmProjPath: string): Promise<boolean> {
115115
if (!this.context) { logger.warn('[LLM] initializeMultimodal: no context'); return false; }
116116
try {
117-
const sizeMB = (Number((await RNFS.stat(mmProjPath)).size) / (1024 * 1024)).toFixed(1);
118-
logger.log(`[LLM] mmproj file size: ${sizeMB} MB`);
119-
if (Number(sizeMB) < 100) console.warn(`[LLM] WARNING: mmproj file seems too small (${sizeMB} MB)`);
117+
const sizeMB = Number((await RNFS.stat(mmProjPath)).size) / (1024 * 1024);
118+
logger.log(`[LLM] mmproj file size: ${sizeMB.toFixed(1)} MB`);
119+
if (sizeMB < 100) console.warn(`[LLM] WARNING: mmproj file seems too small (${sizeMB.toFixed(1)} MB)`);
120120
} catch (statErr) { console.error('[LLM] Failed to stat mmproj file:', statErr); }
121121
const devInfo = useAppStore.getState().deviceInfo;
122122
const useGpuForClip = Platform.OS === 'ios' && !devInfo?.isEmulator && (devInfo?.totalMemory ?? 0) > 4 * BYTES_PER_GB;

0 commit comments

Comments
 (0)