removed unnecessary hasattr check

This commit is contained in:
Mislav 2025-03-17 22:43:57 +13:00
parent 627abcd082
commit 284eabe1f7

View File

@ -188,11 +188,7 @@ class DocumentConverter:
def _get_pipeline_options_hash(self, pipeline_options: PipelineOptions) -> str: def _get_pipeline_options_hash(self, pipeline_options: PipelineOptions) -> str:
"""Generate a hash of pipeline options to use as part of the cache key.""" """Generate a hash of pipeline options to use as part of the cache key."""
options_str = str( options_str = str(pipeline_options.model_dump())
pipeline_options.model_dump()
if hasattr(pipeline_options, "model_dump")
else pipeline_options
)
return hashlib.md5(options_str.encode("utf-8")).hexdigest() return hashlib.md5(options_str.encode("utf-8")).hexdigest()
def initialize_pipeline(self, format: InputFormat): def initialize_pipeline(self, format: InputFormat):