Skip to content

Commit 3a3bceb

Browse files
namchuailouis-janJamesjan-hiro-vhiento09
authored
Release/v0.4.9 (#2421)
* fix: turn off experimental settings should also turn off quick ask (#2411) * fix: app glitches 1s generating response before starting model (#2412) * fix: disable experimental feature should also disable vulkan (#2414) * fix: model load stuck on windows when can't get CPU core count (#2413) Signed-off-by: James <[email protected]> Co-authored-by: James <[email protected]> * feat: TensorRT-LLM engine update support (#2415) * fix: engine update * chore: add remove prepopulated models Signed-off-by: James <[email protected]> * update tinyjensen url Signed-off-by: James <[email protected]> * update llamacorn Signed-off-by: James <[email protected]> * update Mistral 7B Instruct v0.1 int4 Signed-off-by: James <[email protected]> * update tensorrt Signed-off-by: James <[email protected]> * update Signed-off-by: hiro <[email protected]> * update Signed-off-by: James <[email protected]> * prettier Signed-off-by: James <[email protected]> * update mistral config Signed-off-by: James <[email protected]> * fix some lint Signed-off-by: James <[email protected]> --------- Signed-off-by: James <[email protected]> Signed-off-by: hiro <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: hiro <[email protected]> * Tensorrt LLM disable turing support (#2418) Co-authored-by: Hien To <[email protected]> * chore: add prompt template tensorrtllm (#2375) * chore: add prompt template tensorrtllm * Add Prompt template for mistral and correct model metadata --------- Co-authored-by: Hien To <[email protected]> * fix: correct tensorrt mistral model.json (#2419) --------- Signed-off-by: James <[email protected]> Signed-off-by: hiro <[email protected]> Co-authored-by: Louis <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: hiro <[email protected]> Co-authored-by: hiento09 <[email protected]> Co-authored-by: Hien To <[email protected]>
1 parent c81a33f commit 3a3bceb

File tree

21 files changed

+328
-71
lines changed

21 files changed

+328
-71
lines changed

.github/workflows/jan-electron-linter-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
branches:
2323
- main
2424
- dev
25+
- release/**
2526
paths:
2627
- "electron/**"
2728
- .github/workflows/jan-electron-linter-and-test.yml

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"devDependencies": {
4848
"@types/jest": "^29.5.12",
49-
"@types/node": "^12.0.2",
49+
"@types/node": "^20.11.4",
5050
"eslint": "8.57.0",
5151
"eslint-plugin-jest": "^27.9.0",
5252
"jest": "^29.7.0",

core/src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export enum FileManagerRoute {
9696
fileStat = 'fileStat',
9797
writeBlob = 'writeBlob',
9898
mkdir = 'mkdir',
99+
rm = 'rm',
99100
}
100101

101102
export type ApiFunction = (...args: any[]) => any

core/src/extension.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface Compatibility {
1919
const ALL_INSTALLATION_STATE = [
2020
'NotRequired', // not required.
2121
'Installed', // require and installed. Good to go.
22+
'Updatable', // require and installed but need to be updated.
2223
'NotInstalled', // require to be installed.
2324
'Corrupted', // require but corrupted. Need to redownload.
2425
] as const
@@ -59,6 +60,13 @@ export abstract class BaseExtension implements ExtensionType {
5960
return undefined
6061
}
6162

63+
/**
64+
* Determine if the extension is updatable.
65+
*/
66+
updatable(): boolean {
67+
return false
68+
}
69+
6270
/**
6371
* Determine if the prerequisites for the extension are installed.
6472
*

core/src/fs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const mkdir = (...args: any[]) => global.core.api?.mkdir(...args)
4545
*/
4646
const rmdirSync = (...args: any[]) =>
4747
global.core.api?.rmdirSync(...args, { recursive: true, force: true })
48+
49+
const rm = (path: string) => global.core.api?.rm(path)
50+
4851
/**
4952
* Deletes a file from the local file system.
5053
* @param {string} path - The path of the file to delete.
@@ -96,6 +99,7 @@ export const fs = {
9699
mkdirSync,
97100
mkdir,
98101
rmdirSync,
102+
rm,
99103
unlinkSync,
100104
appendFileSync,
101105
copyFileSync,

core/src/node/api/processors/fsExt.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,16 @@ export class FSExt implements Processor {
100100
})
101101
})
102102
}
103+
104+
rmdir(path: string): Promise<void> {
105+
return new Promise((resolve, reject) => {
106+
fs.rm(path, { recursive: true }, (err) => {
107+
if (err) {
108+
reject(err)
109+
} else {
110+
resolve()
111+
}
112+
})
113+
})
114+
}
103115
}

core/src/node/helper/config.ts

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,34 @@ export const getJanExtensionsPath = (): string => {
8282
*/
8383
export const physicalCpuCount = async (): Promise<number> => {
8484
const platform = os.platform()
85-
if (platform === 'linux') {
86-
const output = await exec('lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l')
87-
return parseInt(output.trim(), 10)
88-
} else if (platform === 'darwin') {
89-
const output = await exec('sysctl -n hw.physicalcpu_max')
90-
return parseInt(output.trim(), 10)
91-
} else if (platform === 'win32') {
92-
const output = await exec('WMIC CPU Get NumberOfCores')
93-
return output
94-
.split(os.EOL)
95-
.map((line: string) => parseInt(line))
96-
.filter((value: number) => !isNaN(value))
97-
.reduce((sum: number, number: number) => sum + number, 1)
98-
} else {
99-
const cores = os.cpus().filter((cpu: any, index: number) => {
100-
const hasHyperthreading = cpu.model.includes('Intel')
101-
const isOdd = index % 2 === 1
102-
return !hasHyperthreading || isOdd
103-
})
104-
return cores.length
85+
try {
86+
if (platform === 'linux') {
87+
const output = await exec('lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l')
88+
return parseInt(output.trim(), 10)
89+
} else if (platform === 'darwin') {
90+
const output = await exec('sysctl -n hw.physicalcpu_max')
91+
return parseInt(output.trim(), 10)
92+
} else if (platform === 'win32') {
93+
const output = await exec('WMIC CPU Get NumberOfCores')
94+
return output
95+
.split(os.EOL)
96+
.map((line: string) => parseInt(line))
97+
.filter((value: number) => !isNaN(value))
98+
.reduce((sum: number, number: number) => sum + number, 1)
99+
} else {
100+
const cores = os.cpus().filter((cpu: any, index: number) => {
101+
const hasHyperthreading = cpu.model.includes('Intel')
102+
const isOdd = index % 2 === 1
103+
return !hasHyperthreading || isOdd
104+
})
105+
return cores.length
106+
}
107+
} catch (err) {
108+
console.warn('Failed to get physical CPU count', err)
109+
// Divide by 2 to get rid of hyper threading
110+
const coreCount = Math.ceil(os.cpus().length / 2)
111+
console.debug('Using node API to get physical CPU count:', coreCount)
112+
return coreCount
105113
}
106114
}
107115

core/src/node/helper/resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SystemResourceInfo } from '../../types'
22
import { physicalCpuCount } from './config'
3-
import { log, logServer } from './log'
3+
import { log } from './log'
44

55
export const getSystemResourceInfo = async (): Promise<SystemResourceInfo> => {
66
const cpu = await physicalCpuCount()

extensions/model-extension/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class JanModelExtension extends ModelExtension {
3838
private static readonly _tensorRtEngineFormat = '.engine'
3939
private static readonly _configDirName = 'config'
4040
private static readonly _defaultModelFileName = 'default-model.json'
41-
private static readonly _supportedGpuArch = ['turing', 'ampere', 'ada']
41+
private static readonly _supportedGpuArch = ['ampere', 'ada']
4242

4343
/**
4444
* Called when the extension is loaded.

extensions/monitoring-extension/src/node/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ const updateNvidiaDriverInfo = async () =>
181181
const getGpuArch = (gpuName: string): string => {
182182
if (!gpuName.toLowerCase().includes('nvidia')) return 'unknown'
183183

184-
if (gpuName.includes('20')) return 'turing'
185-
else if (gpuName.includes('30')) return 'ampere'
184+
if (gpuName.includes('30')) return 'ampere'
186185
else if (gpuName.includes('40')) return 'ada'
187186
else return 'unknown'
188187
}

0 commit comments

Comments
 (0)