Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions js/src/lib/interfaces/Libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export enum ModelLibrary {
"sentence-transformers" = "Sentence Transformers",
"sklearn" = "Scikit-learn",
"spacy" = "spaCy",
"span_marker" = "SpanMarker",
"speechbrain" = "speechbrain",
"tensorflowtts" = "TensorFlowTTS",
"timm" = "Timm",
Expand Down Expand Up @@ -314,6 +315,11 @@ nlp = spacy.load("${nameWithoutNamespace(model.id)}")
import ${nameWithoutNamespace(model.id)}
nlp = ${nameWithoutNamespace(model.id)}.load()`;

const span_marker = (model: ModelData) =>
`from span_marker import SpanMarkerModel

model = SpanMarkerModel.from_pretrained("${model.id}")`;

const stanza = (model: ModelData) =>
`import stanza

Expand Down Expand Up @@ -528,6 +534,12 @@ export const MODEL_LIBRARIES_UI_ELEMENTS: Partial<Record<ModelLibraryKey, Librar
repoUrl: "https://github.com/explosion/spaCy",
snippet: spacy,
},
"span_marker": {
btnLabel: "SpanMarker",
repoName: "SpanMarkerNER",
repoUrl: "https://github.com/tomaarsen/SpanMarkerNER",
snippet: span_marker,
},
"speechbrain": {
btnLabel: "speechbrain",
repoName: "speechbrain",
Expand Down
3 changes: 3 additions & 0 deletions js/src/lib/interfaces/LibrariesToTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLi
"text-classification",
"sentence-similarity",
],
"span_marker": [
"token-classification",
],
"speechbrain": [
"audio-classification",
"audio-to-audio",
Expand Down