Skip to content

Commit 1bc8319

Browse files
committed
Add support for EDS-NLP library
1 parent fffe16e commit 1bc8319

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ export const diffusers = (model: ModelData): string[] => {
9696
}
9797
};
9898

99+
export const edsnlp = (model: ModelData): string[] => {
100+
const packageName = nameWithoutNamespace(model.id).replaceAll("-", "_");
101+
return [
102+
`# Load it from the huggingface hub directly
103+
import edsnlp
104+
nlp = edsnlp.load("${model.id}")
105+
`,
106+
`# Or install it as a package
107+
!pip install git+https://huggingface.co/${model.id}
108+
109+
# and import it as a module
110+
import ${packageName}
111+
112+
nlp = ${packageName}.load() # or edsnlp.load("${packageName}")
113+
`,
114+
];
115+
};
116+
99117
export const espnetTTS = (model: ModelData): string[] => [
100118
`from espnet2.bin.tts_inference import Text2Speech
101119

packages/tasks/src/model-libraries.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
125125
repoName: "doctr",
126126
repoUrl: "https://github.com/mindee/doctr",
127127
},
128+
edsnlp: {
129+
prettyLabel: "EDS-NLP",
130+
repoName: "edsnlp",
131+
repoUrl: "https://github.com/aphp/edsnlp",
132+
filter: false,
133+
snippets: snippets.edsnlp,
134+
countDownloads: {
135+
wildcard: { path: "*/config.cfg" },
136+
},
137+
},
128138
elm: {
129139
prettyLabel: "ELM",
130140
repoName: "elm",

0 commit comments

Comments
 (0)