Skip to content

Commit 6f43bb1

Browse files
committed
Add support for EDS-NLP library
1 parent b82ea88 commit 6f43bb1

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
@@ -97,6 +97,24 @@ export const diffusers = (model: ModelData): string[] => {
9797
}
9898
};
9999

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

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)