Hi, I have noticed that when using DesignInputSpecification as an input fed directly to the run method on the RFD3InferenceEngine, the run always crashes when _multiply_specifications is invoked. This is due to the fact that DesignInputSpecification object is not subscriptable, yet example_spec is attempted to be set:
def _multiply_specifications(
self, inputs: Dict[str, dict | DesignInputSpecification], n_batches=None
) -> Dict[str, Dict[str, Any]]:
...
# Based on inputs, construct the specifications to loop through
design_specifications = {}
for prefix, example_spec in inputs.items():
# Record task name in the specification
example_spec["extra"]["task_name"] = prefix
It seems like this does not happen when running RFD3 using JSON inputs, since the process_input function in engine.py returns a dictionary. In this case accessing "extra" key works without issues. However, when I attempt to feed a dictionary into .run() method on the engine instance, I get _canonicalize_inputs throwing an error complaining that a dictionary input is not supported.
This issue can be easily mitigated by using a dictionary example_spec_ in _multiply_specifications:
def _multiply_specifications(
self, inputs: Dict[str, dict | DesignInputSpecification], n_batches=None
) -> Dict[str, Dict[str, Any]]:
# Find existing example IDS in output directory
if exists(self.out_dir):
existing_example_ids = set(
extract_example_id_from_path(path, CIF_LIKE_EXTENSIONS)
for path in find_files_with_extension(self.out_dir, CIF_LIKE_EXTENSIONS)
)
ranked_logger.info(
f"Found {len(existing_example_ids)} existing example IDs in the output directory."
)
# Based on inputs, construct the specifications to loop through
design_specifications = {}
for prefix, example_spec in inputs.items():
# Record task name in the specification
example_spec_ = example_spec.model_dump()
example_spec_["extra"]["task_name"] = prefix
# ... Create n_batches for example
for batch_id in range((n_batches) if exists(n_batches) else 1):
# ... Example ID
example_id = f"{prefix}_{batch_id}" if exists(n_batches) else prefix
if (
self.skip_existing
and exists(self.out_dir)
and example_id in existing_example_ids
):
ranked_logger.info(
f"Skipping design specification for example {example_id} | Already exists."
)
continue
design_specifications[example_id] = example_spec_
return design_specifications
Please let me know if such a fix is OK for you, I could submit a PR for this. Or feel free to fix it on your end if you prefer no external contributions 🙂
Many thanks for providing this amazing repository, it's truly impressive how RFDiffusion has evolved!
Hi, I have noticed that when using
DesignInputSpecificationas an input fed directly to therunmethod on theRFD3InferenceEngine, the run always crashes when_multiply_specificationsis invoked. This is due to the fact thatDesignInputSpecificationobject is not subscriptable, yetexample_specis attempted to be set:It seems like this does not happen when running RFD3 using JSON inputs, since the
process_inputfunction inengine.pyreturns a dictionary. In this case accessing"extra"key works without issues. However, when I attempt to feed a dictionary into.run()method on the engine instance, I get_canonicalize_inputsthrowing an error complaining that a dictionary input is not supported.This issue can be easily mitigated by using a dictionary
example_spec_in_multiply_specifications:Please let me know if such a fix is OK for you, I could submit a PR for this. Or feel free to fix it on your end if you prefer no external contributions 🙂
Many thanks for providing this amazing repository, it's truly impressive how RFDiffusion has evolved!