From 46aa9d3a29d93d402573c08112e5939a369c0094 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Wed, 28 Aug 2024 13:57:50 +0700 Subject: [PATCH 1/3] fix: responsive modal import model gguf --- .../ModelDownloadList/index.tsx | 2 +- .../ModelDownloadRow/index.tsx | 30 ++++++++++++------- .../ModelSegmentInfo/index.tsx | 2 +- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx index e6285565f..e59ee3416 100644 --- a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx +++ b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx @@ -29,7 +29,7 @@ const ModelDownloadList = () => { return (

Available Versions

- + {ggufModels.map((model, index) => { if (!model.downloadUrl) return null return ( diff --git a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadRow/index.tsx b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadRow/index.tsx index 98914c94e..951a11d59 100644 --- a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadRow/index.tsx +++ b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadRow/index.tsx @@ -10,6 +10,8 @@ import { Badge, Button, Progress } from '@janhq/joi' import { useAtomValue, useSetAtom } from 'jotai' +import { twMerge } from 'tailwind-merge' + import { MainViewState } from '@/constants/screens' import { useCreateNewThread } from '@/hooks/useCreateNewThread' @@ -114,16 +116,24 @@ const ModelDownloadRow: React.FC = ({ } return ( -
-
- {quantization && ( - - {quantization} - - )} -

- {fileName} -

+
+
+
+ {quantization && ( + + {quantization} + + )} +

+ {fileName} +

+
{toGibibytes(fileSize)} diff --git a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelSegmentInfo/index.tsx b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelSegmentInfo/index.tsx index ba17e9b57..10f4515c8 100644 --- a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelSegmentInfo/index.tsx +++ b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelSegmentInfo/index.tsx @@ -33,7 +33,7 @@ const ModelSegmentInfo = () => { if (!importingHuggingFaceRepoData) return null return ( -
+

{modelName} From 31ae14c1f1aa7069ac822f801237d90518f19553 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Wed, 28 Aug 2024 17:04:47 +0700 Subject: [PATCH 2/3] chore: fix responsive and add tensorrt_llm nitro to model utils --- .../HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx | 2 +- web/utils/modelEngine.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx index e59ee3416..a1d153d10 100644 --- a/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx +++ b/web/screens/Settings/HuggingFaceRepoDetailModal/ModelDownloadList/index.tsx @@ -29,7 +29,7 @@ const ModelDownloadList = () => { return (

Available Versions

- + {ggufModels.map((model, index) => { if (!model.downloadUrl) return null return ( diff --git a/web/utils/modelEngine.ts b/web/utils/modelEngine.ts index a12e9bb0e..3d132c5d5 100644 --- a/web/utils/modelEngine.ts +++ b/web/utils/modelEngine.ts @@ -4,6 +4,7 @@ export const getLogoEngine = (engine: InferenceEngine) => { switch (engine) { case InferenceEngine.anthropic: return 'images/ModelProvider/anthropic.svg' + case InferenceEngine.nitro_tensorrt_llm: case InferenceEngine.nitro: return 'images/ModelProvider/nitro.svg' case InferenceEngine.cortex_llamacpp: @@ -43,6 +44,8 @@ export const getTitleByEngine = (engine: InferenceEngine) => { switch (engine) { case InferenceEngine.nitro: return 'Llama.cpp (Nitro)' + case InferenceEngine.nitro_tensorrt_llm: + return 'TensorRT-LLM (Nitro)' case InferenceEngine.cortex_llamacpp: return 'Llama.cpp (Cortex)' case InferenceEngine.cortex_onnx: From e41f816fc8122c69458c5f4c291ae6de012addec Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Wed, 28 Aug 2024 17:24:57 +0700 Subject: [PATCH 3/3] chore: fix system monitor gpu list --- .../BottomPanel/SystemMonitor/index.tsx | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx index 7fb20b0a4..4fd902075 100644 --- a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx +++ b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx @@ -159,35 +159,40 @@ const SystemMonitor = () => { {gpus.length > 0 && (
- {gpus.map((gpu, index) => ( -
-
- - {gpu.name} - -
-
- - {gpu.memoryTotal - gpu.memoryFree}/ - {gpu.memoryTotal} - - MB + {gpus.map((gpu, index) => { + const gpuUtilization = Math.round( + (gpu.memoryFree / Math.max(gpu.memoryTotal, 1)) * 100 + ) + return ( +
+
+ + {gpu.name} + +
+
+ + {gpu.memoryTotal - gpu.memoryFree}/ + {gpu.memoryTotal} + + MB +
-
-
- - - {gpu.utilization}% - +
+ + + {gpuUtilization}% + +
-
- ))} + ) + })}
)}