Open nighting0le01 opened 3 days ago
class CacheDoublyLinkedList:
# ... [rest of your class definition] ...
def index(self, op: Operation) -> int:
"""
Find the index of an operation in the linked list.
"""
cursor = self.start
idx = 0
while cursor is not None:
if cursor.op == op:
return idx
cursor = cursor.next
idx += 1
raise ValueError(f"{op} is not in the list")
maybe something like this to use .index over the linked list
🐞Describing the bug
using the torch2coreml script with the --chunk-unet option would result in the following error: AttributeError: 'CacheDoublyLinkedList' object has no attribute 'index'. This error occurred because the index attribute has been removed from the CacheDoublyLinkedList class in the latest versions of coremltools.:https://github.com/apple/ml-stable-diffusion/pull/327
Stack Trace
To Reproduce
use coreml==7.2 and try to run https://github.com/apple/ml-stable-diffusion?tab=readme-ov-file#-converting-models-to-core-ml
python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --convert-safety-checker --model-version <model-version-string-from-hub> -o <output-mlpackages-directory>
System environment (please complete the following information):
Additional context