chore: audio

This commit is contained in:
jialin
2024-11-25 20:07:17 +08:00
parent 961d420c95
commit 7fcd005f06
13 changed files with 159 additions and 151 deletions
@@ -264,6 +264,11 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
value: backendOptionsMap.vllm,
disabled:
source === modelSourceMap.local_path_value ? false : isGGUF
},
{
label: 'vox-box',
value: backendOptionsMap.voxBox,
disabled: false
}
]}
disabled={
+61 -24
View File
@@ -423,6 +423,66 @@ const Models: React.FC<ModelsProps> = ({
[]
);
const renderModelTags = useCallback((record: ListItem) => {
if (record.reranker) {
return (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
Reranker
</Tag>
);
}
if (record.embedding_only && !record.reranker) {
return (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
Embedding Only
</Tag>
);
}
if (record.text_to_speech) {
return (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
{intl.formatMessage({ id: 'playground.audio.texttospeech' })}
</Tag>
);
}
if (record.speech_to_text) {
return (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
{intl.formatMessage({ id: 'playground.audio.speechtotext' })}
</Tag>
);
}
return null;
}, []);
const renderChildren = useCallback(
(list: any, parent?: any) => {
return (
@@ -548,30 +608,7 @@ const Models: React.FC<ModelsProps> = ({
<AutoTooltip ghost>
<span className="m-r-5">{text}</span>
</AutoTooltip>
{record.reranker && (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
Reranker
</Tag>
)}
{record.embedding_only && !record.reranker && (
<Tag
style={{
margin: 0,
opacity: 0.8,
transform: 'scale(0.9)'
}}
color="geekblue"
>
Embedding Only
</Tag>
)}
{renderModelTags(record)}
</span>
);
}}
+2 -1
View File
@@ -69,7 +69,8 @@ export const ollamaModelOptions = [
export const backendOptionsMap = {
llamaBox: 'llama-box',
vllm: 'vllm'
vllm: 'vllm',
voxBox: 'vox-box'
};
export const modelSourceMap: Record<string, string> = {
+2
View File
@@ -11,6 +11,8 @@ export interface ListItem {
model_scope_model_id: string;
embedding_only?: boolean;
ready_replicas: number;
speech_to_text?: boolean;
text_to_speech?: boolean;
replicas: number;
s3Address: string;
name: string;