Generate unique ID for a kernel.
(self, model_name: str, operation: str, code: str)
| 114 | self.save_config(config) |
| 115 | |
| 116 | def _generate_kernel_id(self, model_name: str, operation: str, code: str) -> str: |
| 117 | """Generate unique ID for a kernel.""" |
| 118 | content = f"{model_name}:{operation}:{code}" |
| 119 | return hashlib.sha256(content.encode()).hexdigest()[:16] |
| 120 | |
| 121 | def cache_kernel(self, model_name: str, operation: str, kernel_data: Dict[str, Any]): |
| 122 | """Cache a kernel and its metadata.""" |
no outgoing calls