Skip to content

Commit

Permalink
refactor: make document loading pep8 compliant. (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurarpit authored May 10, 2024
1 parent a2f0312 commit ad944e9
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/backend/batch/utilities/document_loading/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List
import os.path
import pkgutil
from .Strategies import LoadingStrategy
from .strategies import LoadingStrategy


class LoadingSettings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List
from .DocumentLoadingBase import DocumentLoadingBase
from .document_loading_base import DocumentLoadingBase
from ..helpers.AzureFormRecognizerHelper import AzureFormRecognizerClient
from ..common.SourceDocument import SourceDocument

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List
from .DocumentLoadingBase import DocumentLoadingBase
from .document_loading_base import DocumentLoadingBase
from ..helpers.AzureFormRecognizerHelper import AzureFormRecognizerClient
from ..common.SourceDocument import SourceDocument

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from enum import Enum
from .Layout import LayoutDocumentLoading
from .Read import ReadDocumentLoading
from .Web import WebDocumentLoading
from .WordDocument import WordDocumentLoading
from .layout import LayoutDocumentLoading
from .read import ReadDocumentLoading
from .web import WebDocumentLoading
from .word_document import WordDocumentLoading


class LoadingStrategy(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
from langchain.docstore.document import Document
from langchain_community.document_loaders import WebBaseLoader
from .DocumentLoadingBase import DocumentLoadingBase
from .document_loading_base import DocumentLoadingBase
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from io import BytesIO
from docx import Document
import requests
from .DocumentLoadingBase import DocumentLoadingBase
from .document_loading_base import DocumentLoadingBase
from ..common.SourceDocument import SourceDocument


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from langchain.docstore.document import Document
from ..document_loading import LoadingSettings
from ..document_loading.Strategies import get_document_loader
from ..document_loading.strategies import get_document_loader


class DocumentLoading:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
)
from backend.batch.utilities.document_chunking.chunking_strategy import ChunkingSettings
from backend.batch.utilities.document_loading import LoadingSettings
from backend.batch.utilities.document_loading.Strategies import LoadingStrategy
from backend.batch.utilities.document_loading.strategies import LoadingStrategy

AZURE_SEARCH_INDEXER_NAME = "mock-indexer-name"
CHUNKING_SETTINGS = ChunkingSettings({"strategy": "layout", "size": 1, "overlap": 0})
Expand Down
2 changes: 1 addition & 1 deletion code/tests/utilities/helpers/test_PushEmbedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from backend.batch.utilities.helpers.embedders.PushEmbedder import PushEmbedder
from backend.batch.utilities.document_chunking.chunking_strategy import ChunkingSettings
from backend.batch.utilities.document_loading import LoadingSettings
from backend.batch.utilities.document_loading.Strategies import LoadingStrategy
from backend.batch.utilities.document_loading.strategies import LoadingStrategy
from backend.batch.utilities.common.SourceDocument import SourceDocument
from backend.batch.utilities.helpers.config.EmbeddingConfig import EmbeddingConfig

Expand Down

0 comments on commit ad944e9

Please sign in to comment.