Skip to content

Commit

Permalink
chore: bumb nitro version (#740)
Browse files Browse the repository at this point in the history
* chore: take out experimental feature and bump nitro version

* chore: update inference module to use nitro 0.1.17
  • Loading branch information
louis-jan authored Nov 28, 2023
1 parent 9bf39cb commit 0ffc81e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 57 deletions.
2 changes: 1 addition & 1 deletion plugins/inference-plugin/nitro/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.11
0.1.17
5 changes: 0 additions & 5 deletions web/containers/Layout/Ribbon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ import { twMerge } from 'tailwind-merge'

import LogoMark from '@/containers/Brand/Logo/Mark'

import { FeatureToggleContext } from '@/context/FeatureToggle'

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

import { useMainViewState } from '@/hooks/useMainViewState'

export default function RibbonNav() {
const { mainViewState, setMainViewState } = useMainViewState()
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)

const onMenuClick = (state: MainViewState) => {
if (mainViewState === state) return
Expand All @@ -49,8 +46,6 @@ export default function RibbonNav() {
]

const secondaryMenus = [
// Add menu if experimental feature
...(experimentalFeatureEnabed ? [] : []),
{
name: 'Explore Models',
icon: <CpuIcon size={20} className="flex-shrink-0" />,
Expand Down
3 changes: 0 additions & 3 deletions web/containers/Layout/TopBar/CommandSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { MainViewState } from '@/constants/screens'
import { useMainViewState } from '@/hooks/useMainViewState'

export default function CommandSearch() {
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)
const { setMainViewState } = useMainViewState()

const menus = [
Expand All @@ -44,8 +43,6 @@ export default function CommandSearch() {
),
state: MainViewState.Chat,
},
// Added experimental feature here
...(experimentalFeatureEnabed ? [] : []),
{
name: 'Explore Models',
icon: <CpuIcon size={16} className="mr-3 text-muted-foreground" />,
Expand Down
9 changes: 1 addition & 8 deletions web/screens/Chat/ChatBody/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
import { useContext } from 'react'

import { useAtomValue } from 'jotai'

import { FeatureToggleContext } from '@/context/FeatureToggle'

import ChatInstruction from '../ChatInstruction'
import ChatItem from '../ChatItem'

import { getCurrentChatMessagesAtom } from '@/helpers/atoms/ChatMessage.atom'

const ChatBody: React.FC = () => {
const messages = useAtomValue(getCurrentChatMessagesAtom)
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)
return (
<div className="flex h-full w-full flex-col-reverse overflow-y-auto">
{messages.map((message) => (
<ChatItem {...message} key={message.id} />
))}
{experimentalFeatureEnabed && messages.length === 0 && (
<ChatInstruction />
)}
{messages.length === 0 && <ChatInstruction />}
</div>
)
}
Expand Down
8 changes: 4 additions & 4 deletions web/screens/Chat/ChatInstruction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const ChatInstruction = () => {
}
return (
<div className="mx-auto mb-20 flex flex-col space-y-2">
<p>
What does this Assistant do? How does it behave? What should it avoid
doing?
</p>
{!isSettingInstruction && activeConvoId && (
<>
<p>
What does this Assistant do? How does it behave? What should it
avoid doing?
</p>
<Button
themes={'outline'}
className="w-32"
Expand Down
36 changes: 16 additions & 20 deletions web/screens/Chat/SimpleTextMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const marked = new Marked(
)

const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)
const parsedText = marked.parse(props.content ?? '')
const isUser = props.role === ChatCompletionRole.User
const isSystem = props.role === ChatCompletionRole.System
Expand All @@ -61,7 +60,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
const messages = useAtomValue(getCurrentChatMessagesAtom)

useEffect(() => {
if (props.status === MessageStatus.Ready || !experimentalFeatureEnabed) {
if (props.status === MessageStatus.Ready) {
return
}
const currentTimestamp = new Date().getTime() // Get current time in milliseconds
Expand Down Expand Up @@ -91,18 +90,16 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
{!isUser && !isSystem && <LogoMark width={20} />}
<div className="text-sm font-extrabold capitalize">{props.role}</div>
<p className="text-xs font-medium">{displayDate(props.createdAt)}</p>
{experimentalFeatureEnabed && (
<div
className={twMerge(
'absolute right-0 cursor-pointer transition-all',
messages[0].id === props.id
? 'absolute -bottom-10 left-4'
: 'hidden group-hover:flex'
)}
>
<MessageToolbar message={props} />
</div>
)}
<div
className={twMerge(
'absolute right-0 cursor-pointer transition-all',
messages[0].id === props.id
? 'absolute -bottom-10 left-4'
: 'hidden group-hover:flex'
)}
>
<MessageToolbar message={props} />
</div>
</div>

<div className={twMerge('w-full')}>
Expand All @@ -122,12 +119,11 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
</>
)}
</div>
{experimentalFeatureEnabed &&
(props.status === MessageStatus.Pending || tokenSpeed > 0) && (
<p className="mt-2 text-xs font-medium text-foreground">
Token Speed: {Number(tokenSpeed).toFixed(2)}/s
</p>
)}
{(props.status === MessageStatus.Pending || tokenSpeed > 0) && (
<p className="mt-2 text-xs font-medium text-foreground">
Token Speed: {Number(tokenSpeed).toFixed(2)}/s
</p>
)}
</div>
)
}
Expand Down
26 changes: 10 additions & 16 deletions web/screens/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const ChatScreen = () => {
const [isModelAvailable, setIsModelAvailable] = useState(
downloadedModels.some((x) => x.id === currentConvo?.modelId)
)
const { experimentalFeatureEnabed } = useContext(FeatureToggleContext)

const textareaRef = useRef<HTMLTextAreaElement>(null)
const { startModel } = useActiveModel()
const modelRef = useRef(activeModel)
Expand Down Expand Up @@ -176,20 +174,16 @@ const ChatScreen = () => {
Download Model
</Button>
)}
{experimentalFeatureEnabed && (
<Paintbrush
size={16}
className="cursor-pointer text-muted-foreground"
onClick={() => cleanConvo()}
/>
)}
{
<Trash2Icon
size={16}
className="cursor-pointer text-muted-foreground"
onClick={() => deleteConvo()}
/>
}
<Paintbrush
size={16}
className="cursor-pointer text-muted-foreground"
onClick={() => cleanConvo()}
/>
<Trash2Icon
size={16}
className="cursor-pointer text-muted-foreground"
onClick={() => deleteConvo()}
/>
</div>
</div>
</div>
Expand Down

0 comments on commit 0ffc81e

Please sign in to comment.