diff --git a/docs/pipes/embeddings/assets/transformer-windowing.svg b/docs/assets/images/transformer-windowing.svg similarity index 100% rename from docs/pipes/embeddings/assets/transformer-windowing.svg rename to docs/assets/images/transformer-windowing.svg diff --git a/docs/pipeline.md b/docs/pipeline.md index 8d1d1b00..85d33772 100644 --- a/docs/pipeline.md +++ b/docs/pipeline.md @@ -57,7 +57,7 @@ model(pdf_bytes) model.pipe([pdf_bytes, ...]) ``` -For more information on how to use the pipeline, refer to the [Inference](../inference) page. +For more information on how to use the pipeline, refer to the [Inference](/inference) page. ## Hybrid models diff --git a/edspdf/pipeline.py b/edspdf/pipeline.py index 8b008d7d..51359064 100644 --- a/edspdf/pipeline.py +++ b/edspdf/pipeline.py @@ -854,7 +854,7 @@ def __exit__(ctx_self, type, value, traceback): return context() -def load(config: Union[Path, str, Config]): +def load(config: Union[Path, str, Config]) -> Pipeline: error = "The load function expects a Config or a path to a config file" if isinstance(config, (Path, str)): path = Path(config) diff --git a/edspdf/pipes/embeddings/box_transformer.py b/edspdf/pipes/embeddings/box_transformer.py index 95f5ac9d..13172544 100644 --- a/edspdf/pipes/embeddings/box_transformer.py +++ b/edspdf/pipes/embeddings/box_transformer.py @@ -61,8 +61,8 @@ class BoxTransformer(TrainablePipe[EmbeddingOutput]): Initializing with a value close to 0 can help the training converge. attention_mode: Sequence[RelativeAttentionMode] Mode of relative position infused attention layer. - See the [relative attention](relative_attention) documentation for more - information. + See the [relative attention][edspdf.layers.relative_attention.RelativeAttention] + documentation for more information. n_layers: int Number of layers in the Transformer """ diff --git a/edspdf/pipes/embeddings/huggingface_embedding.py b/edspdf/pipes/embeddings/huggingface_embedding.py index d2d24489..16ccf076 100644 --- a/edspdf/pipes/embeddings/huggingface_embedding.py +++ b/edspdf/pipes/embeddings/huggingface_embedding.py @@ -42,7 +42,7 @@ class HuggingfaceEmbedding(TrainablePipe[EmbeddingOutput]): occurrence that is the closest to the center of its window. Here is an overview how this works in a classifier model : - ![Transformer windowing](./assets/transformer-windowing.svg) + ![Transformer windowing](/assets/images/transformer-windowing.svg) Examples -------- @@ -82,7 +82,8 @@ class HuggingfaceEmbedding(TrainablePipe[EmbeddingOutput]): ) ``` - This model can then be trained following the [training recipe](/recipes/training/). + This model can then be trained following the + [training recipe](/recipes/training/). Parameters ---------- diff --git a/mkdocs.yml b/mkdocs.yml index b15ef621..51a1e16f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -125,6 +125,7 @@ plugins: show_root_toc_entry: false show_signature: false merge_init_into_class: true + - autolinks - glightbox: touchNavigation: true loop: false @@ -155,3 +156,6 @@ markdown_extensions: - pymdownx.emoji: emoji_index: !!python/name:materialx.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg + +validation: + absolute_links: ignore diff --git a/pyproject.toml b/pyproject.toml index c218fc6d..ea8df287 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ docs = [ "mkdocstrings~=0.20", "mkdocstrings-python~=1.1", "mkdocs-autorefs@git+https://github.com/percevalw/mkdocs-autorefs.git@0.4.1.post0", + "mkdocs-autolinks-plugin~=0.7.1", "mkdocs-gen-files~=0.4.0", "mkdocs-literate-nav~=0.6.0", "mkdocs-material~=9.1.0",