diff --git a/.github/workflows/jan-electron-linter-and-test.yml b/.github/workflows/jan-electron-linter-and-test.yml index 300ee59bc..b2105acb4 100644 --- a/.github/workflows/jan-electron-linter-and-test.yml +++ b/.github/workflows/jan-electron-linter-and-test.yml @@ -320,6 +320,7 @@ jobs: # TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}' - uses: actions/upload-artifact@v4 + if: always() with: name: playwright-report path: electron/playwright-report/ diff --git a/extensions/inference-cortex-extension/src/node/execute.test.ts b/extensions/inference-cortex-extension/src/node/execute.test.ts index 89110fbd9..a1b5c4ba4 100644 --- a/extensions/inference-cortex-extension/src/node/execute.test.ts +++ b/extensions/inference-cortex-extension/src/node/execute.test.ts @@ -49,7 +49,7 @@ describe('test executable cortex file', () => { enginePath: expect.stringContaining(`mac-arm64`), executablePath: originalPlatform === 'darwin' - ? expect.stringContaining(`/cortex`) + ? expect.stringContaining(`/cortex-server`) : expect.anything(), cudaVisibleDevices: '', vkVisibleDevices: '', @@ -63,7 +63,7 @@ describe('test executable cortex file', () => { enginePath: expect.stringContaining(`mac-x64`), executablePath: originalPlatform === 'darwin' - ? expect.stringContaining(`/cortex`) + ? expect.stringContaining(`/cortex-server`) : expect.anything(), cudaVisibleDevices: '', vkVisibleDevices: '', @@ -82,7 +82,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`win`), - executablePath: expect.stringContaining(`/cortex.exe`), + executablePath: expect.stringContaining(`/cortex-server.exe`), cudaVisibleDevices: '', vkVisibleDevices: '', }) @@ -116,7 +116,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`win-cuda-11-7`), - executablePath: expect.stringContaining(`/cortex.exe`), + executablePath: expect.stringContaining(`/cortex-server.exe`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -150,7 +150,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`win-cuda-12-0`), - executablePath: expect.stringContaining(`/cortex.exe`), + executablePath: expect.stringContaining(`/cortex-server.exe`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -168,7 +168,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '', vkVisibleDevices: '', }) @@ -202,7 +202,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux-cuda-11-7`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -236,7 +236,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux-cuda-12-0`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -260,7 +260,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux-${instruction}`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '', vkVisibleDevices: '', @@ -283,7 +283,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`win-${instruction}`), - executablePath: expect.stringContaining(`/cortex.exe`), + executablePath: expect.stringContaining(`/cortex-server.exe`), cudaVisibleDevices: '', vkVisibleDevices: '', }) @@ -322,7 +322,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`win-cuda-12-0`), - executablePath: expect.stringContaining(`/cortex.exe`), + executablePath: expect.stringContaining(`/cortex-server.exe`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -361,7 +361,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux-cuda-12-0`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -401,7 +401,7 @@ describe('test executable cortex file', () => { expect(executableCortexFile(settings)).toEqual( expect.objectContaining({ enginePath: expect.stringContaining(`linux-vulkan`), - executablePath: expect.stringContaining(`/cortex`), + executablePath: expect.stringContaining(`/cortex-server`), cudaVisibleDevices: '0', vkVisibleDevices: '0', }) @@ -429,7 +429,7 @@ describe('test executable cortex file', () => { enginePath: expect.stringContaining(`mac-x64`), executablePath: originalPlatform === 'darwin' - ? expect.stringContaining(`/cortex`) + ? expect.stringContaining(`/cortex-server`) : expect.anything(), cudaVisibleDevices: '', vkVisibleDevices: '', diff --git a/extensions/inference-cortex-extension/src/node/execute.ts b/extensions/inference-cortex-extension/src/node/execute.ts index 0febe8adf..b5f848332 100644 --- a/extensions/inference-cortex-extension/src/node/execute.ts +++ b/extensions/inference-cortex-extension/src/node/execute.ts @@ -99,7 +99,7 @@ export const executableCortexFile = ( .join('-') let cudaVisibleDevices = gpuSetting?.gpus_in_use.join(',') ?? '' let vkVisibleDevices = gpuSetting?.gpus_in_use.join(',') ?? '' - let binaryName = `cortex${extension()}` + let binaryName = `cortex-server${extension()}` return { enginePath: path.join(__dirname, '..', 'bin', engineFolder), diff --git a/web/hooks/useModels.ts b/web/hooks/useModels.ts index f884a591e..2b5351098 100644 --- a/web/hooks/useModels.ts +++ b/web/hooks/useModels.ts @@ -11,6 +11,8 @@ import { import { useSetAtom } from 'jotai' +import { useDebouncedCallback } from 'use-debounce' + import { isLocalEngine } from '@/utils/modelEngine' import { extensionManager } from '@/extension' @@ -53,17 +55,19 @@ const useModels = () => { Promise.all([getDownloadedModels(), getExtensionModels()]) }, [setDownloadedModels, setExtensionModels]) + const reloadData = useDebouncedCallback(() => getData(), 300) + useEffect(() => { // Try get data on mount - getData() + reloadData() // Listen for model updates - events.on(ModelEvent.OnModelsUpdate, async () => getData()) + events.on(ModelEvent.OnModelsUpdate, async () => reloadData()) return () => { // Remove listener on unmount events.off(ModelEvent.OnModelsUpdate, async () => {}) } - }, [getData]) + }, [reloadData]) } const getModels = async (): Promise => diff --git a/web/screens/Thread/ThreadCenterPanel/ChatBody/EmptyThread/index.tsx b/web/screens/Thread/ThreadCenterPanel/ChatBody/EmptyThread/index.tsx index 6fc05d44b..a99e6306f 100644 --- a/web/screens/Thread/ThreadCenterPanel/ChatBody/EmptyThread/index.tsx +++ b/web/screens/Thread/ThreadCenterPanel/ChatBody/EmptyThread/index.tsx @@ -8,6 +8,8 @@ import LogoMark from '@/containers/Brand/Logo/Mark' import { MainViewState } from '@/constants/screens' +import { isLocalEngine } from '@/utils/modelEngine' + import { mainViewStateAtom } from '@/helpers/atoms/App.atom' import { downloadedModelsAtom } from '@/helpers/atoms/Model.atom' @@ -15,8 +17,7 @@ const EmptyThread = () => { const downloadedModels = useAtomValue(downloadedModelsAtom) const setMainViewState = useSetAtom(mainViewStateAtom) const showOnboardingStep = - downloadedModels.filter((e) => e.engine === InferenceEngine.nitro) - .length === 0 + downloadedModels.filter((e) => isLocalEngine(e.engine)).length === 0 return (