Skip to content

Commit 61904f4

Browse files
authored
Add Keras as supported library (#380)
1 parent bd990f2 commit 61904f4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

widgets/src/lib/interfaces/Libraries.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum ModelLibrary {
99
'asteroid' = 'Asteroid',
1010
'espnet' = 'ESPnet',
1111
'flair' = 'Flair',
12+
'keras' = 'Keras',
1213
'pyannote' = 'Pyannote',
1314
'sentence-transformers' = 'Sentence Transformers',
1415
'sklearn' = 'Scikit-learn',
@@ -118,6 +119,12 @@ const flair = (model: ModelData) =>
118119
119120
tagger = SequenceTagger.load("${model.modelId}")`;
120121

122+
const keras = (model: ModelData) =>
123+
`from huggingface_hub import from_pretrained_keras
124+
125+
model = from_pretrained_keras("${model.modelId}")
126+
`;
127+
121128
const pyannote = (model: ModelData) =>
122129
`from pyannote.audio.core.inference import Inference
123130
@@ -272,6 +279,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS: { [key in keyof typeof ModelLibrary]:
272279
repoUrl: "https://github.com/flairNLP/flair",
273280
snippet: flair,
274281
},
282+
keras: {
283+
btnLabel: "Keras",
284+
repoName: "Keras",
285+
repoUrl: "https://github.com/keras-team/keras",
286+
snippet: keras,
287+
},
275288
pyannote: {
276289
btnLabel: "pyannote",
277290
repoName: "pyannote-audio",

0 commit comments

Comments
 (0)