Skip to content

Commit

Permalink
add: temporally add talkativot service site as iframe in model card o…
Browse files Browse the repository at this point in the history
…f talkativot-standalone
  • Loading branch information
lizable committed Jan 10, 2025
1 parent 83bbf80 commit 79d032e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 21 deletions.
44 changes: 30 additions & 14 deletions react/src/components/ModelCardModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,36 @@ const ModelCardModal: React.FC<ModelCardModalProps> = ({
gap={'sm'}
style={{ flex: 1 }}
>
<ModelCardChat
basePath={
model_card?.name?.includes('stable-diffusion-3-medium')
? 'generate-image'
: 'v1'
}
modelName={
model_card?.name === 'stable-diffusion-3-medium'
? 'stable-diffusion-3m'
: model_card?.name === 'Llama-3.2-11B-Vision-Instruct'
? 'llama-vision-11b'
: model_card?.name || ''
}
/>
{model_card?.name === 'Talkativot UI' ? (
// FIXME: temporally add iframe for Talkativot UI
<iframe
src="https://talkativot-aiot-demo.asia03.app.backend.ai/chat"
style={{
width: '100%',
height: '100%',
border: 'none',
}}
title="Talkativot AIOT Demo"
/>
) : (
<ModelCardChat
basePath={
model_card?.name?.includes(
'stable-diffusion-3-medium',
)
? 'generate-image'
: 'v1'
}
modelName={
model_card?.name === 'stable-diffusion-3-medium'
? 'stable-diffusion-3m'
: model_card?.name ===
'Llama-3.2-11B-Vision-Instruct'
? 'llama-vision-11b'
: model_card?.name || ''
}
/>
)}
</Flex>
<Divider type="vertical" style={{ height: '100%' }} />
<Flex
Expand Down
24 changes: 17 additions & 7 deletions react/src/components/ModelTryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
);

const filteredModelStoreList = myModelStoreList.filter((vFolder) =>
vFolder.name.includes(modelName || ''),
vFolder.name.includes(
modelName === 'Talkativot UI' ? 'talkativot-standalone' : modelName || '',
),
);

const mutationToClone = useTanMutation<
Expand Down Expand Up @@ -207,7 +209,9 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
? 'stable-diffusion-3m'
: modelName?.includes('Llama-3.2-11B-Vision-Instruct')
? 'llama-vision-11b'
: modelName;
: modelName?.includes('Talkativot UI')
? 'talkativot'
: modelName;
return {
serviceName: `${model}-${generateRandomString(4)}`,
desiredRoutingCount: 1,
Expand Down Expand Up @@ -267,7 +271,9 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
resource: {
cpu: 4,
mem: '32g',
accelerator: minAIAcclResource,
accelerator: modelName?.includes('Talkativot UI')
? 0
: minAIAcclResource,
acceleratorType: 'cuda.shares',
shmem: '1g',
},
Expand Down Expand Up @@ -299,10 +305,10 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
cloneable: true,
permission: 'wd', // write-delete permission
target_host: modelStorageHost, // lowestUsageHost, // clone to accessible and lowest usage storage host
target_name: `${modelName}-1`,
target_name: `${modelName === 'Talkativot UI' ? 'talkativot-standalone-1' : modelName}`,
usage_mode: 'model',
},
name: `${modelName}`,
name: `${modelName === 'Talkativot UI' ? 'talkativot-standalone' : modelName}`,
},
{
onSuccess: (data) => {
Expand Down Expand Up @@ -525,7 +531,10 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
)}
<Button
type="primary"
disabled={modelName?.includes('stable-diffusion')}
disabled={
modelName?.includes('stable-diffusion') ||
modelName?.includes('Talkativot UI')
}
onClick={() => {
cloneOrCreateModelService('vllm');
}}
Expand All @@ -540,7 +549,8 @@ const ModelTryContent: React.FC<ModelTryContentProps> = ({
disabled={
modelName?.includes('stable-diffusion') ||
modelName?.includes('gemma-2-27b-it') ||
modelName?.includes('Llama-3.2-11B-Vision-Instruct')
modelName?.includes('Llama-3.2-11B-Vision-Instruct') ||
modelName?.includes('Talkativot UI')
}
type="primary"
onClick={() => {
Expand Down
1 change: 1 addition & 0 deletions react/src/pages/ModelStoreListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ const ModelStoreListPage: React.FC = () => {
'gemma-2-27b-it',
'Llama-3.2-11B-Vision-Instruct',
'stable-diffusion-3-medium',
'Talkativot UI',
];
const aIndex = specialNames.indexOf(a?.name || '');
const bIndex = specialNames.indexOf(b?.name || '');
Expand Down

0 comments on commit 79d032e

Please sign in to comment.