Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shouples committed Nov 2, 2023
1 parent 1ba182c commit f1fc383
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dx/formatters/summarizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class DataFrameSummarizer:
summarizing_func: Optional[Callable] = None

def __init__(self, summarizing_func: Optional[Callable] = None):
self.summarizing_func = summarizing_func
if summarizing_func is None:
self._try_to_load_repr_llm()
else:
self.summarizing_func = summarizing_func

self._load_repr_llm()

def _load_repr_llm(self) -> None:
def _try_to_load_repr_llm(self) -> None:
"""Load repr_llm's summarize_dataframe into the summarizing_func if it's available."""
try:
from repr_llm.pandas import summarize_dataframe
Expand Down

0 comments on commit f1fc383

Please sign in to comment.