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

Integrate ThirdAI Library #689

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions packages/tasks/src/library-to-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[
"text2text-generation",
],
stanza: ["token-classification"],
thirdai: [
"text-classification",
"token-classification",
],
timm: ["image-classification"],
transformers: [
"audio-classification",
Expand Down
21 changes: 21 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,27 @@ export const tensorflowtts = (model: ModelData): string[] => {
return tensorflowttsUnknown(model);
};

const thirdaiUDT = (model: ModelData): string[] => [
`from thirdai import bolt

model = bolt.UniversalDeepTransformer.load("${model.id}")
`,
];

const thirdaiNeuralDB = (model: ModelData): string[] => [
`from thirdai import neural_db as ndb

model = ndb.NeuralDB.from_checkpoint("${model.id}")
`,
];

export const thirdai = (model: ModelData): string[] => {
if (model.tags.includes("neural-db")) {
return thirdaiNeuralDB(model);
}
return thirdaiUDT(model);
};

export const timm = (model: ModelData): string[] => [
`import timm

Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
repoUrl: "https://github.com/TensorSpeech/TensorFlowTTS",
snippets: snippets.tensorflowtts,
},
thirdai: {
prettyLabel: "thirdai",
repoName: "thirdai",
repoUrl: "https://github.com/ThirdAILabs/Demos",
snippets: snippets.thirdai,
filter: false,
},
timesfm: {
prettyLabel: "TimesFM",
repoName: "timesfm",
Expand Down
10 changes: 9 additions & 1 deletion packages/tasks/src/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
"tabular-classification": ["sklearn"],
"tabular-regression": ["sklearn"],
"tabular-to-text": ["transformers"],
"text-classification": ["adapter-transformers", "setfit", "spacy", "transformers", "transformers.js"],
"text-classification": [
"adapter-transformers",
"setfit",
"spacy",
"thirdai",
"transformers",
"transformers.js"
],
"text-generation": ["transformers", "transformers.js"],
"text-retrieval": [],
"text-to-image": ["diffusers"],
Expand All @@ -158,6 +165,7 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
"spacy",
"span-marker",
"stanza",
"thirdai",
"transformers",
"transformers.js",
],
Expand Down