Skip to content

Commit

Permalink
move id_to_hash to interfaces.py
Browse files Browse the repository at this point in the history
  • Loading branch information
micmarty-deepsense committed Apr 4, 2024
1 parent 793ef37 commit bec0b90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions unstructured/ingest/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,10 @@ def process_file(
logger.info(f"Processing {self.filename}")

elements = self.partition_file(partition_config=partition_config, **partition_kwargs)

for idx, element in enumerate(elements):
element.id_to_hash(idx)

element_dicts = elements_to_dicts(elements)

self.isd_elems_no_filename: t.List[t.Dict[str, t.Any]] = []
Expand Down
3 changes: 0 additions & 3 deletions unstructured/ingest/pipeline/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def run(self, ingest_doc_dict) -> Optional[str]:
**partition_kwargs,
)

for idx, element in enumerate(elements):
element.id_to_hash(idx)

with open(json_path, "w", encoding="utf8") as output_f:
logger.info(f"writing partitioned content to {json_path}")
json.dump(elements, output_f, ensure_ascii=False, indent=2, sort_keys=True)
Expand Down

0 comments on commit bec0b90

Please sign in to comment.