Skip to content

Commit bc7381c

Browse files
Borg93Vaibhavs10Wauplin
authored
Add HTRflow as a library (#1008)
This PR adds https://github.com/AI-Riksarkivet/htrflow/ as a library. --------- Co-authored-by: vb <[email protected]> Co-authored-by: Lucain <[email protected]>
1 parent f2795a8 commit bc7381c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,23 @@ export const gliner = (model: ModelData): string[] => [
363363
model = GLiNER.from_pretrained("${model.id}")`,
364364
];
365365

366+
export const htrflow = (model: ModelData): string[] => [
367+
`# CLI usage
368+
# see docs: https://ai-riksarkivet.github.io/htrflow/latest/getting_started/quick_start.html
369+
htrflow pipeline <path/to/pipeline.yaml> <path/to/image>`,
370+
`# Python usage
371+
from htrflow.pipeline.pipeline import Pipeline
372+
from htrflow.pipeline.steps import Task
373+
from htrflow.models.framework.model import ModelClass
374+
375+
pipeline = Pipeline(
376+
[
377+
Task(
378+
ModelClass, {"model": "${model.id}"}, {}
379+
),
380+
])`,
381+
];
382+
366383
export const keras = (model: ModelData): string[] => [
367384
`# Available backend options are: "jax", "torch", "tensorflow".
368385
import os

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
317317
docsUrl: "https://hezarai.github.io/hezar",
318318
countDownloads: `path:"model_config.yaml" OR path:"embedding/embedding_config.yaml"`,
319319
},
320+
htrflow: {
321+
prettyLabel: "HTRflow",
322+
repoName: "HTRflow",
323+
repoUrl: "https://github.com/AI-Riksarkivet/htrflow",
324+
docsUrl: "https://ai-riksarkivet.github.io/htrflow",
325+
snippets: snippets.htrflow,
326+
},
320327
"hunyuan-dit": {
321328
prettyLabel: "HunyuanDiT",
322329
repoName: "HunyuanDiT",

0 commit comments

Comments
 (0)