Skip to content

Commit

Permalink
Add HTRflow as a library (#1008)
Browse files Browse the repository at this point in the history
This PR adds https://github.com/AI-Riksarkivet/htrflow/ as a library.

---------

Co-authored-by: vb <[email protected]>
Co-authored-by: Lucain <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2024
1 parent f2795a8 commit bc7381c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,23 @@ export const gliner = (model: ModelData): string[] => [
model = GLiNER.from_pretrained("${model.id}")`,
];

export const htrflow = (model: ModelData): string[] => [
`# CLI usage
# see docs: https://ai-riksarkivet.github.io/htrflow/latest/getting_started/quick_start.html
htrflow pipeline <path/to/pipeline.yaml> <path/to/image>`,
`# Python usage
from htrflow.pipeline.pipeline import Pipeline
from htrflow.pipeline.steps import Task
from htrflow.models.framework.model import ModelClass
pipeline = Pipeline(
[
Task(
ModelClass, {"model": "${model.id}"}, {}
),
])`,
];

export const keras = (model: ModelData): string[] => [
`# Available backend options are: "jax", "torch", "tensorflow".
import os
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 @@ -317,6 +317,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
docsUrl: "https://hezarai.github.io/hezar",
countDownloads: `path:"model_config.yaml" OR path:"embedding/embedding_config.yaml"`,
},
htrflow: {
prettyLabel: "HTRflow",
repoName: "HTRflow",
repoUrl: "https://github.com/AI-Riksarkivet/htrflow",
docsUrl: "https://ai-riksarkivet.github.io/htrflow",
snippets: snippets.htrflow,
},
"hunyuan-dit": {
prettyLabel: "HunyuanDiT",
repoName: "HunyuanDiT",
Expand Down

0 comments on commit bc7381c

Please sign in to comment.