Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.12] [ML] Update external URLs for E5 models (#172796) #172975

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record<string, ModelDefinition> = Object
defaultMessage: 'E5 (EmbEddings from bidirEctional Encoder rEpresentations)',
}),
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small',
type: ['pytorch', 'text_embedding'],
},
'.multilingual-e5-small_linux-x86_64': {
Expand All @@ -122,6 +123,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record<string, ModelDefinition> = Object
'E5 (EmbEddings from bidirEctional Encoder rEpresentations), optimized for linux-x86_64',
}),
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64',
type: ['pytorch', 'text_embedding'],
},
} as const);
Expand All @@ -142,9 +144,13 @@ export interface ModelDefinition {
os?: string;
arch?: string;
default?: boolean;
/** Indicates if model version is recommended for deployment based on the cluster configuration */
recommended?: boolean;
hidden?: boolean;
/** Software license of a model, e.g. MIT */
license?: string;
/** Link to the external license/documentation page */
licenseUrl?: string;
type?: readonly string[];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,6 @@ const ClickToDownloadTabContent: FC<ClickToDownloadTabContentProps> = ({
/>
</EuiLink>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge
color="hollow"
target={'_blank'}
href={'https://huggingface.co/elastic/multilingual-e5-small-optimized'}
>
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.mitLicenseLabel"
defaultMessage="License: MIT"
/>
</EuiBadge>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size={'l'} />
</div>
Expand Down Expand Up @@ -286,25 +274,45 @@ const ClickToDownloadTabContent: FC<ClickToDownloadTabContentProps> = ({
{model.model_id}
</EuiText>
</EuiFlexItem>
{model.recommended ? (
<EuiFlexItem grow={false}>
<EuiToolTip
content={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.recommendedDownloadContent"
defaultMessage="Recommended ELSER model version for your cluster's hardware configuration"
/>
}
>
<EuiBadge color="hollow">
<FormattedMessage
id="xpack.ml.trainedModels.addModelFlyout.recommendedDownloadLabel"
defaultMessage="Recommended"
/>
</EuiBadge>
</EuiToolTip>
</EuiFlexItem>
) : null}
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize={'s'} alignItems={'center'}>
{model.recommended ? (
<EuiFlexItem grow={false}>
<EuiToolTip
content={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.recommendedDownloadContent"
defaultMessage="Recommended model version for your cluster's hardware configuration"
/>
}
>
<EuiBadge color="hollow">
<FormattedMessage
id="xpack.ml.trainedModels.addModelFlyout.recommendedDownloadLabel"
defaultMessage="Recommended"
/>
</EuiBadge>
</EuiToolTip>
</EuiFlexItem>
) : null}
{model.licenseUrl && model.softwareLicense ? (
<EuiFlexItem grow={false}>
<EuiBadge
color="hollow"
target={'_blank'}
href={model.licenseUrl}
>
{model.softwareLicense === 'MIT' ? (
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.mitLicenseLabel"
defaultMessage="License: MIT"
/>
) : null}
</EuiBadge>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
}
name={model.model_id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export type ModelItem = TrainedModelConfigResponse & {
modelName?: string;
os?: string;
arch?: string;
softwareLicense?: string;
licenseUrl?: string;
};

export type ModelItemFull = Required<ModelItem>;
Expand Down Expand Up @@ -280,6 +282,8 @@ export const ModelsList: FC<Props> = ({
modelName: modelDefinition.modelName,
os: modelDefinition.os,
arch: modelDefinition.arch,
softwareLicense: modelDefinition.license,
licenseUrl: modelDefinition.licenseUrl,
} as ModelItem;
});
resultItems = [...resultItems, ...notDownloaded];
Expand Down Expand Up @@ -534,7 +538,7 @@ export const ModelsList: FC<Props> = ({
content={
<FormattedMessage
id="xpack.ml.trainedModels.modelsList.recommendedDownloadContent"
defaultMessage="Recommended ELSER model version for your cluster's hardware configuration"
defaultMessage="Recommended model version for your cluster's hardware configuration"
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ describe('modelsProvider', () => {
version: 1,
modelName: 'e5',
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small',
type: ['pytorch', 'text_embedding'],
},
{
Expand All @@ -100,6 +101,7 @@ describe('modelsProvider', () => {
version: 1,
modelName: 'e5',
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64',
type: ['pytorch', 'text_embedding'],
},
]);
Expand Down Expand Up @@ -167,6 +169,7 @@ describe('modelsProvider', () => {
modelName: 'e5',
type: ['pytorch', 'text_embedding'],
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small',
},
{
arch: 'amd64',
Expand All @@ -179,6 +182,7 @@ describe('modelsProvider', () => {
modelName: 'e5',
type: ['pytorch', 'text_embedding'],
license: 'MIT',
licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64',
},
]);
});
Expand Down
Loading