Skip to content

Commit

Permalink
Chore: Change CommandR to unavailable (#2722)
Browse files Browse the repository at this point in the history
* fix: move to comming soon

* fix: Q4 for consistancy

* version pump extension

* pump version model

* fix: highlight unsupported tag

---------

Co-authored-by: Louis <[email protected]>
  • Loading branch information
hahuyhoang411 and louis-menlo authored Apr 15, 2024
1 parent aff6a7d commit b908ae2
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 35 deletions.
2 changes: 1 addition & 1 deletion extensions/inference-nitro-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@janhq/inference-nitro-extension",
"productName": "Nitro Inference Engine",
"version": "1.0.0",
"version": "1.0.1",
"description": "This extension embeds Nitro, a lightweight (3mb) inference engine written in C++. See https://nitro.jan.ai.\nAdditional dependencies could be installed to run without Cuda Toolkit installation.",
"main": "dist/index.js",
"node": "dist/node/index.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"id": "command-r-34b",
"object": "model",
"name": "Command-R v01 34B Q4",
"version": "1.0",
"version": "1.1",
"description": "C4AI Command-R developed by CohereAI is optimized for a variety of use cases including reasoning, summarization, and question answering.",
"format": "gguf",
"settings": {
Expand All @@ -27,7 +27,7 @@
},
"metadata": {
"author": "CohereAI",
"tags": ["34B", "Finetuned"],
"tags": ["34B", "Finetuned", "Coming Soon", "Unavailable"],
"size": 21500000000
},
"engine": "nitro"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"sources": [
{
"filename": "wizardcoder-python-13b-v1.0.Q5_K_M.gguf",
"url": "https://huggingface.co/TheBloke/WizardCoder-Python-13B-V1.0-GGUF/resolve/main/wizardcoder-python-13b-v1.0.Q5_K_M.gguf"
"filename": "wizardcoder-python-13b-v1.0.Q4_K_M.gguf",
"url": "https://huggingface.co/TheBloke/WizardCoder-Python-13B-V1.0-GGUF/resolve/main/wizardcoder-python-13b-v1.0.Q4_K_M.gguf"
}
],
"id": "wizardcoder-13b",
"object": "model",
"name": "Wizard Coder Python 13B Q5",
"version": "1.0",
"name": "Wizard Coder Python 13B Q4",
"version": "1.1",
"description": "WizardCoder 13B is a Python coding model. This model demonstrate high proficiency in specific domains like coding and mathematics.",
"format": "gguf",
"settings": {
"ctx_len": 4096,
"prompt_template": "### Instruction:\n{prompt}\n### Response:",
"llama_model_path": "wizardcoder-python-13b-v1.0.Q5_K_M.gguf"
"llama_model_path": "wizardcoder-python-13b-v1.0.Q4_K_M.gguf"
},
"parameters": {
"temperature": 0.7,
Expand Down
2 changes: 1 addition & 1 deletion web/containers/DropdownListSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const DropdownListSidebar = ({
{toGibibytes(x.metadata.size)}
</span>
{x.metadata.size && (
<ModelLabel size={x.metadata.size} />
<ModelLabel metadata={x.metadata} />
)}
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion web/containers/Layout/TopBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import CommandSearch from '@/containers/Layout/TopBar/CommandSearch'

import { showLeftSideBarAtom } from '@/containers/Providers/KeyListener'

import { toaster } from '@/containers/Toast'

import { MainViewState } from '@/constants/screens'

import { useClickOutside } from '@/hooks/useClickOutside'
Expand Down Expand Up @@ -61,7 +63,11 @@ const TopBar = () => {

const onCreateConversationClick = async () => {
if (assistants.length === 0) {
alert('No assistant available')
toaster({
title: 'No assistant available.',
description: `Could not create a new thread. Please add an assistant.`,
type: 'error',
})
} else {
requestCreateNewThread(assistants[0])
}
Expand Down
19 changes: 16 additions & 3 deletions web/containers/ModelLabel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react'

import { ModelMetadata } from '@janhq/core'
import { Badge } from '@janhq/uikit'
import { useAtomValue } from 'jotai'

import { useActiveModel } from '@/hooks/useActiveModel'
Expand All @@ -19,10 +21,17 @@ import {
} from '@/helpers/atoms/SystemBar.atom'

type Props = {
size: number
metadata: ModelMetadata
}
const UnsupportedModel = () => {
return (
<Badge className="space-x-1 rounded-md" themes="warning">
<span>Coming Soon</span>
</Badge>
)
}

const ModelLabel: React.FC<Props> = ({ size }) => {
const ModelLabel: React.FC<Props> = ({ metadata }) => {
const { activeModel } = useActiveModel()
const totalRam = useAtomValue(totalRamAtom)
const usedRam = useAtomValue(usedRamAtom)
Expand Down Expand Up @@ -52,7 +61,11 @@ const ModelLabel: React.FC<Props> = ({ size }) => {
return null
}

return getLabel(size)
return metadata.tags.includes('Coming Soon') ? (
<UnsupportedModel />
) : (
getLabel(metadata.size ?? 0)
)
}

export default React.memo(ModelLabel)
32 changes: 10 additions & 22 deletions web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { twMerge } from 'tailwind-merge'

import ModalCancelDownload from '@/containers/ModalCancelDownload'

import ModelLabel from '@/containers/ModelLabel'

import { toaster } from '@/containers/Toast'

import { MainViewState } from '@/constants/screens'

import { useCreateNewThread } from '@/hooks/useCreateNewThread'
Expand Down Expand Up @@ -47,22 +51,6 @@ type Props = {
open: string
}

const getLabel = (size: number, ram: number, unit: string = 'RAM') => {
if (size * 1.25 >= ram) {
return (
<Badge className="rounded-md" themes="danger">
Not enough {unit}
</Badge>
)
} else {
return (
<Badge className="rounded-md" themes="success">
Recommended
</Badge>
)
}
}

const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
const { downloadModel } = useDownloadModel()
const downloadingModels = useAtomValue(getDownloadingModelAtom)
Expand Down Expand Up @@ -105,7 +93,11 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {

const onUseModelClick = useCallback(async () => {
if (assistants.length === 0) {
alert('No assistant available')
toaster({
title: 'No assistant available.',
description: `Could not use Model ${model.name} as no assistant is available.`,
type: 'error',
})
return
}
await requestCreateNewThread(assistants[0], model)
Expand Down Expand Up @@ -163,11 +155,7 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
<span className="mr-4 font-semibold text-muted-foreground">
{toGibibytes(model.metadata.size)}
</span>
{getLabel(
model.metadata.size,
ram,
settings?.run_mode === 'gpu' ? 'VRAM' : 'RAM'
)}
{<ModelLabel metadata={model.metadata} />}

{downloadButton}
<ChevronDownIcon
Expand Down

0 comments on commit b908ae2

Please sign in to comment.