Skip to content

Commit

Permalink
feat: expose server instance (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
marknguyen1302 authored Aug 23, 2024
1 parent 337de1e commit 952c0eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions cortex-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async function startServer(dataFolderPath?: string) {
dataFolderPath: dataFolderPath || config.dataFolderPath,
cortexCppPort: enginePort,
});
return app;
} catch (e) {
console.error(e);
// revert the data folder path if it was set
Expand Down
14 changes: 8 additions & 6 deletions cortex-js/src/usecases/engines/engines.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,17 @@ export class EnginesUsecases {
engine === Engines.llamaCPP &&
(options?.vulkan ||
(options?.runMode === 'GPU' && options?.gpuType !== 'Nvidia'));
const platformMatcher =
process.platform === 'win32'
? '-windows'
: process.platform === 'darwin'
? '-mac'
: '-linux';
installPackages.push(
this.installAcceleratedEngine(options?.version ?? 'latest', engine, [
process.platform === 'win32'
? '-windows'
: process.platform === 'darwin'
? '-mac'
: '-linux',
platformMatcher,
// CPU Instructions - CPU | GPU Non-Vulkan
!isVulkan && engine === Engines.llamaCPP
!isVulkan && engine === Engines.llamaCPP && platformMatcher !== '-mac'
? `-noavx`
: '',
// Cuda
Expand Down

0 comments on commit 952c0eb

Please sign in to comment.