commit
a990fa6c07
@ -27,7 +27,7 @@ export function useActiveModel() {
|
|||||||
(activeModel && activeModel.id === modelId) ||
|
(activeModel && activeModel.id === modelId) ||
|
||||||
(stateModel.model === modelId && stateModel.loading)
|
(stateModel.model === modelId && stateModel.loading)
|
||||||
) {
|
) {
|
||||||
console.debug(`Model ${modelId} is already init. Ignore..`)
|
console.debug(`Model ${modelId} is already initialized. Ignore..`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,13 +64,13 @@ export function useActiveModel() {
|
|||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
console.debug(
|
console.debug(
|
||||||
`Init model ${modelId} successfully!, take ${
|
`Model ${modelId} successfully initialized! Took ${
|
||||||
Date.now() - currentTime
|
Date.now() - currentTime
|
||||||
}ms`
|
}ms`
|
||||||
)
|
)
|
||||||
setActiveModel(model)
|
setActiveModel(model)
|
||||||
toaster({
|
toaster({
|
||||||
title: 'Success start a Model',
|
title: 'Success!',
|
||||||
description: `Model ${modelId} has been started.`,
|
description: `Model ${modelId} has been started.`,
|
||||||
})
|
})
|
||||||
setStateModel(() => ({
|
setStateModel(() => ({
|
||||||
@ -89,7 +89,7 @@ export function useActiveModel() {
|
|||||||
setActiveModel(undefined)
|
setActiveModel(undefined)
|
||||||
setStateModel({ state: 'start', loading: false, model: '' })
|
setStateModel({ state: 'start', loading: false, model: '' })
|
||||||
toaster({
|
toaster({
|
||||||
title: 'Success stop a Model',
|
title: 'Success!',
|
||||||
description: `Model ${modelId} has been stopped.`,
|
description: `Model ${modelId} has been stopped.`,
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export default function useSendChatMessage() {
|
|||||||
const summaryMsg: ChatCompletionMessage = {
|
const summaryMsg: ChatCompletionMessage = {
|
||||||
role: ChatCompletionRole.User,
|
role: ChatCompletionRole.User,
|
||||||
content:
|
content:
|
||||||
'summary this conversation in less than 5 words, the response should just include the summary',
|
'Summarize this conversation in less than 5 words, the response should just include the summary',
|
||||||
}
|
}
|
||||||
// Request convo summary
|
// Request convo summary
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|||||||
@ -31,10 +31,7 @@ const ChatInstruction = () => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto mb-20 flex flex-col space-y-2">
|
<div className="mx-auto mb-20 flex flex-col space-y-2">
|
||||||
<p>
|
<p>(Optional) Give your assistant an initial prompt.</p>
|
||||||
What does this Assistant do? How does it behave? What should it avoid
|
|
||||||
doing?
|
|
||||||
</p>
|
|
||||||
{!isSettingInstruction && activeConvoId && (
|
{!isSettingInstruction && activeConvoId && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
@ -42,7 +39,7 @@ const ChatInstruction = () => {
|
|||||||
className="w-32"
|
className="w-32"
|
||||||
onClick={() => setIsSettingInstruction(true)}
|
onClick={() => setIsSettingInstruction(true)}
|
||||||
>
|
>
|
||||||
Give Instruction
|
Set a Prompt
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@ -60,7 +57,7 @@ const ChatInstruction = () => {
|
|||||||
className="w-32"
|
className="w-32"
|
||||||
onClick={() => setSystemPrompt(instruction)}
|
onClick={() => setSystemPrompt(instruction)}
|
||||||
>
|
>
|
||||||
Set Instruction
|
Set a Prompt
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -197,8 +197,8 @@ const ChatScreen = () => {
|
|||||||
<div className="mx-auto mt-8 flex h-full w-3/4 flex-col items-center justify-center text-center">
|
<div className="mx-auto mt-8 flex h-full w-3/4 flex-col items-center justify-center text-center">
|
||||||
{downloadedModels.length === 0 && (
|
{downloadedModels.length === 0 && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<h1 className="text-lg font-medium">{`Ups, you don't have a Model`}</h1>
|
<h1 className="text-lg font-medium">{`Oops, you don't have a Model`}</h1>
|
||||||
<p className="mt-1">{`let’s download your first model.`}</p>
|
<p className="mt-1">{`Let’s download your first model.`}</p>
|
||||||
<Button
|
<Button
|
||||||
className="mt-4"
|
className="mt-4"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@ -212,7 +212,7 @@ const ChatScreen = () => {
|
|||||||
{!activeModel && downloadedModels.length > 0 && (
|
{!activeModel && downloadedModels.length > 0 && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<h1 className="text-lg font-medium">{`You don’t have any actively running models`}</h1>
|
<h1 className="text-lg font-medium">{`You don’t have any actively running models`}</h1>
|
||||||
<p className="mt-1">{`Please start a downloaded model in My Models page to use this feature.`}</p>
|
<p className="mt-1">{`Please start a downloaded model to use this feature.`}</p>
|
||||||
<Badge className="mt-4" themes="outline">
|
<Badge className="mt-4" themes="outline">
|
||||||
<ShortCut menu="E" />
|
<ShortCut menu="E" />
|
||||||
to show your model
|
to show your model
|
||||||
|
|||||||
@ -25,17 +25,17 @@ export default function BlankStateMyModel() {
|
|||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<DatabaseIcon size={32} className="mx-auto text-muted-foreground" />
|
<DatabaseIcon size={32} className="mx-auto text-muted-foreground" />
|
||||||
<div className="mt-4">
|
<div className="mt-4">
|
||||||
<h1 className="text-xl font-bold leading-snug">{`Ups, You don't have a model.`}</h1>
|
<h1 className="text-xl font-bold leading-snug">{`Oops, you don't have a model yet.`}</h1>
|
||||||
<p className="mt-1 text-base">
|
<p className="mt-1 text-base">
|
||||||
{downloadStates.length > 0
|
{downloadStates.length > 0
|
||||||
? `Downloading model ... `
|
? `Downloading model ... `
|
||||||
: `let’s download your first model`}
|
: `Let’s download your first model`}
|
||||||
</p>
|
</p>
|
||||||
{downloadStates?.length > 0 && (
|
{downloadStates?.length > 0 && (
|
||||||
<Modal>
|
<Modal>
|
||||||
<ModalTrigger asChild>
|
<ModalTrigger asChild>
|
||||||
<Button themes="outline" className="mr-2 mt-6">
|
<Button themes="outline" className="mr-2 mt-6">
|
||||||
<span>{downloadStates.length} Downloading model</span>
|
<span>Downloading {downloadStates.length} model(s)</span>
|
||||||
</Button>
|
</Button>
|
||||||
</ModalTrigger>
|
</ModalTrigger>
|
||||||
<ModalContent>
|
<ModalContent>
|
||||||
|
|||||||
@ -149,7 +149,7 @@ const MyModelsScreen = () => {
|
|||||||
<div className="rounded-lg border border-border bg-background p-4 hover:border-primary/60">
|
<div className="rounded-lg border border-border bg-background p-4 hover:border-primary/60">
|
||||||
<div className="flex h-full flex-col justify-between">
|
<div className="flex h-full flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-lg font-medium">Download more model?</h2>
|
<h2 className="text-lg font-medium">Download more models?</h2>
|
||||||
<p className="mt-2 leading-relaxed">
|
<p className="mt-2 leading-relaxed">
|
||||||
You have <span>{downloadedModels.length}</span> model(s)
|
You have <span>{downloadedModels.length}</span> model(s)
|
||||||
downloaded.
|
downloaded.
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const PreferencePlugins = (props: Props) => {
|
|||||||
}
|
}
|
||||||
toaster({
|
toaster({
|
||||||
title: formatPluginsName(pluginName),
|
title: formatPluginsName(pluginName),
|
||||||
description: 'Success update preferences',
|
description: 'Successfully updated preferences',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const WelcomeScreen = () => {
|
|||||||
>
|
>
|
||||||
Welcome to Jan
|
Welcome to Jan
|
||||||
</h1>
|
</h1>
|
||||||
<p className="mt-1">{`let’s download your first model`}</p>
|
<p className="mt-1">{`Let’s download your first model`}</p>
|
||||||
<Button
|
<Button
|
||||||
className="mt-4"
|
className="mt-4"
|
||||||
onClick={() => setMainViewState(MainViewState.ExploreModels)}
|
onClick={() => setMainViewState(MainViewState.ExploreModels)}
|
||||||
@ -47,7 +47,7 @@ const WelcomeScreen = () => {
|
|||||||
{downloadedModels.length >= 1 && !activeModel && (
|
{downloadedModels.length >= 1 && !activeModel && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<h1 className="mt-2 text-lg font-medium">{`You don’t have any actively running models`}</h1>
|
<h1 className="mt-2 text-lg font-medium">{`You don’t have any actively running models`}</h1>
|
||||||
<p className="mt-1">{`Please start a downloaded model in My Models page to use this feature.`}</p>
|
<p className="mt-1">{`Please start a downloaded model to use this feature.`}</p>
|
||||||
<Badge className="mt-4" themes="outline">
|
<Badge className="mt-4" themes="outline">
|
||||||
<ShortCut menu="E" />
|
<ShortCut menu="E" />
|
||||||
to show your model
|
to show your model
|
||||||
@ -57,7 +57,7 @@ const WelcomeScreen = () => {
|
|||||||
{downloadedModels.length >= 1 && activeModel && (
|
{downloadedModels.length >= 1 && activeModel && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<h1 className="mt-2 text-lg font-medium">{`Your Model is Active`}</h1>
|
<h1 className="mt-2 text-lg font-medium">{`Your Model is Active`}</h1>
|
||||||
<p className="mt-1">{`You are ready to start conversations.`}</p>
|
<p className="mt-1">{`You are ready to converse.`}</p>
|
||||||
<Button
|
<Button
|
||||||
className="mt-4"
|
className="mt-4"
|
||||||
onClick={() => setMainViewState(MainViewState.Chat)}
|
onClick={() => setMainViewState(MainViewState.Chat)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user