Skip to content

Commit

Permalink
Make tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
plutasnyy committed Apr 15, 2024
1 parent cd35ba7 commit f68e5be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 4 additions & 6 deletions unstructured_inference/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
models: Dict[str, UnstructuredModel] = {}


def get_default_model_mappings() -> (
Tuple[
Dict[str, Type[UnstructuredModel]],
Dict[str, dict | LazyDict],
]
):
def get_default_model_mappings() -> Tuple[
Dict[str, Type[UnstructuredModel]],
Dict[str, dict | LazyDict],
]:
"""default model mappings for models that are in `unstructured_inference` repo"""
return {
**{name: UnstructuredDetectronModel for name in DETECTRON2_MODEL_TYPES},
Expand Down
7 changes: 4 additions & 3 deletions unstructured_inference/models/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UnstructuredTableTransformerModel(UnstructuredModel):
def __init__(self):
pass

def predict(self, x: Image, ocr_tokens: Optional[List[Dict]] = None, result_format='html'):
def predict(self, x: Image, ocr_tokens: Optional[List[Dict]] = None, result_format="html"):
"""Predict table structure deferring to run_prediction with ocr tokens
Note:
Expand Down Expand Up @@ -113,8 +113,9 @@ def run_prediction(
prediction = prediction
else:
raise ValueError(
f'result_format {result_format} is not a valid format. '
f'Valid formats are: "html", "dataframe", "cells"')
f"result_format {result_format} is not a valid format. "
f'Valid formats are: "html", "dataframe", "cells"'
)

return prediction

Expand Down

0 comments on commit f68e5be

Please sign in to comment.