File size: 558 Bytes
751b5ac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """File operations a patch step can return. Paths are relative to vllm/."""
from __future__ import annotations
from dataclasses import dataclass
@dataclass
class Copy:
"""Create (or overwrite) ``dst`` with ``text``."""
dst: str
text: str
@dataclass
class Edit:
"""Replace ``old`` with ``new`` in ``path``.
``old`` must occur exactly ``count`` times, otherwise the whole patch
aborts before writing anything. This catches vLLM version drift.
"""
path: str
old: str
new: str
reason: str
count: int = 1
|