Skip to content

Commit 8634e44

Browse files
prathikrPrathik Rao
andauthored
[sdk_v2] only set bootstrap automatically if user does not explicitly set it (#455)
* bug fix * false for tests --------- Co-authored-by: Prathik Rao <prathikrao@microsoft.com>
1 parent c4adbe1 commit 8634e44

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

sdk_v2/js/src/detail/coreInterop.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ export class CoreInterop {
5050
const ext = CoreInterop._getLibraryExtension();
5151

5252
const corePath = path.join(packageDir, `Microsoft.AI.Foundry.Local.Core${ext}`);
53-
if (fs.existsSync(corePath)) {
54-
config.params['FoundryLocalCorePath'] = corePath;
53+
if (fs.existsSync(corePath)) {
54+
config.params['FoundryLocalCorePath'] = corePath;
5555

56-
// Auto-detect if WinML Bootstrap is needed by checking for Bootstrap DLL in FoundryLocalCorePath
56+
// Auto-detect if WinML Bootstrap is needed by checking for Bootstrap DLL in FoundryLocalCorePath
57+
// Only auto-set if the user hasn't explicitly provided a value
58+
if (!('Bootstrap' in config.params)) {
5759
const bootstrapDllPath = path.join(packageDir, 'Microsoft.WindowsAppRuntime.Bootstrap.dll');
5860
if (fs.existsSync(bootstrapDllPath)) {
5961
// WinML Bootstrap DLL found, enable bootstrapping
6062
config.params['Bootstrap'] = 'true';
6163
}
62-
63-
return corePath;
6464
}
65+
66+
return corePath;
67+
}
6568

6669
return null;
6770
}

sdk_v2/js/test/testUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const TEST_CONFIG: FoundryLocalConfig = {
3434
appName: 'FoundryLocalTest',
3535
modelCacheDir: getTestDataSharedPath(),
3636
logLevel: 'warn',
37-
logsDir: path.join(getGitRepoRoot(), 'sdk_v2', 'js', 'logs')
37+
logsDir: path.join(getGitRepoRoot(), 'sdk_v2', 'js', 'logs'),
38+
additionalSettings: { 'Bootstrap': 'false' }
3839
};
3940

4041
export const TEST_MODEL_ALIAS = 'qwen2.5-0.5b';

0 commit comments

Comments
 (0)