fix: some regressions for tensorrt nightly build (#2380)

* fix: some regressions for tensorrt nightly build

Signed-off-by: James <james@jan.ai>
---------

Signed-off-by: hiro <hiro@jan.ai>
Signed-off-by: James <james@jan.ai>
Co-authored-by: hiro <hiro@jan.ai>
Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2024-03-15 17:45:56 +07:00 committed by GitHub
parent a6b483c9d9
commit 5f19983de1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 8 deletions

View File

@ -321,7 +321,7 @@ export default class JanModelExtension extends ModelExtension {
.toLowerCase()
.includes(JanModelExtension._tensorRtEngineFormat)
)
})?.length > 0 // TODO: NamH find better way (can use basename to check the file name with source url)
})?.length > 0 // TODO: find better way (can use basename to check the file name with source url)
)
})

View File

@ -1,7 +1,7 @@
{
"name": "@janhq/tensorrt-llm-extension",
"version": "0.0.3",
"description": "Enables accelerated inference leveraging Nvidia's TensorRT-LLM for optimal GPU hardware optimizations. Compatible with models in TensorRT-LLM format. Requires Nvidia GPU driver and CUDA Toolkit installation.",
"description": "This extension enables Nvidia's TensorRT-LLM for the fastest GPU acceleration. See the [setup guide](https://jan.ai/guides/providers/tensorrt-llm/) for next steps.",
"main": "dist/index.js",
"node": "dist/node/index.cjs.js",
"author": "Jan <service@jan.ai>",

View File

@ -246,7 +246,8 @@ const Advanced = () => {
setGpuEnabled(true)
setShowNotification(false)
snackbar({
description: 'Successfully turned on GPU Accelertion',
description:
'Successfully turned on GPU Acceleration',
type: 'success',
})
setTimeout(() => {
@ -257,7 +258,7 @@ const Advanced = () => {
setGpuEnabled(false)
snackbar({
description:
'Successfully turned off GPU Accelertion',
'Successfully turned off GPU Acceleration',
type: 'success',
})
}

View File

@ -8,6 +8,7 @@ import {
systemInformations,
} from '@janhq/core'
import {
Badge,
Button,
Progress,
Tooltip,
@ -20,6 +21,8 @@ import {
import { InfoCircledIcon } from '@radix-ui/react-icons'
import { useAtomValue } from 'jotai'
import { Marked, Renderer } from 'marked'
import { extensionManager } from '@/extension'
import Extension from '@/extension/Extension'
import { installingExtensionAtom } from '@/helpers/atoms/Extension.atom'
@ -108,6 +111,8 @@ const TensorRtExtensionItem: React.FC<Props> = ({ item }) => {
}
}
const description = marked.parse(item.description ?? '', { async: false })
console.log(description)
return (
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-4 last:border-none">
<div className="flex-1 flex-shrink-0 space-y-1.5">
@ -118,10 +123,12 @@ const TensorRtExtensionItem: React.FC<Props> = ({ item }) => {
<p className="whitespace-pre-wrap text-sm font-semibold leading-relaxed">
v{item.version}
</p>
<Badge>Experimental</Badge>
</div>
<p className="whitespace-pre-wrap leading-relaxed">
{item.description}
</p>
{
// eslint-disable-next-line @typescript-eslint/naming-convention
<div dangerouslySetInnerHTML={{ __html: description }} />
}
</div>
{(!compatibility || compatibility['platform']?.includes(PLATFORM)) &&
@ -204,7 +211,6 @@ const InstallStateIndicator: React.FC<InstallStateProps> = ({
)
}
// TODO: NamH check for dark mode here
switch (installState) {
case 'Installed':
return (
@ -223,4 +229,14 @@ const InstallStateIndicator: React.FC<InstallStateProps> = ({
}
}
const marked: Marked = new Marked({
renderer: {
link: (href, title, text) => {
return Renderer.prototype.link
?.apply(this, [href, title, text])
.replace('<a', "<a class='text-blue-500' target='_blank'")
},
},
})
export default TensorRtExtensionItem