mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
fix (#9145)
This commit is contained in:
parent
edb585228d
commit
e21152358a
@ -1,7 +1,7 @@
|
|||||||
"""Loader that uses unstructured to load files."""
|
"""Loader that uses unstructured to load files."""
|
||||||
import collections
|
import collections
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from typing import IO, Any, Callable, Dict, List, Sequence, Union
|
from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Union
|
||||||
|
|
||||||
from langchain.docstore.document import Document
|
from langchain.docstore.document import Document
|
||||||
from langchain.document_loaders.base import BaseLoader
|
from langchain.document_loaders.base import BaseLoader
|
||||||
@ -39,7 +39,7 @@ class UnstructuredBaseLoader(BaseLoader, ABC):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
mode: str = "single",
|
mode: str = "single",
|
||||||
post_processors: List[Callable] = [],
|
post_processors: Optional[List[Callable]] = None,
|
||||||
**unstructured_kwargs: Any,
|
**unstructured_kwargs: Any,
|
||||||
):
|
):
|
||||||
"""Initialize with file path."""
|
"""Initialize with file path."""
|
||||||
@ -62,7 +62,7 @@ class UnstructuredBaseLoader(BaseLoader, ABC):
|
|||||||
unstructured_kwargs.pop("strategy")
|
unstructured_kwargs.pop("strategy")
|
||||||
|
|
||||||
self.unstructured_kwargs = unstructured_kwargs
|
self.unstructured_kwargs = unstructured_kwargs
|
||||||
self.post_processors = post_processors
|
self.post_processors = post_processors or []
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def _get_elements(self) -> List:
|
def _get_elements(self) -> List:
|
||||||
|
Loading…
Reference in New Issue
Block a user