mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 15:43:45 +08:00
pkl name
This commit is contained in:
@@ -48,6 +48,11 @@ def create_short_name(full_name: str) -> str:
|
||||
return result[:8]
|
||||
|
||||
|
||||
def create_pkl_name(full_name: str) -> str:
|
||||
pkl = re.sub(r'[^a-zA-Z0-9]+', '_', full_name).strip('_').lower()
|
||||
return pkl
|
||||
|
||||
|
||||
def _read_pkl_bytes(pkl_path: Path) -> bytes:
|
||||
manifest = Path(f"{pkl_path}.chunkmanifest")
|
||||
if manifest.exists():
|
||||
@@ -154,14 +159,15 @@ if __name__ == "__main__":
|
||||
_output_dir = Path(args.output_dir)
|
||||
_output_dir.mkdir(exist_ok=True, parents=True)
|
||||
_short_name = create_short_name(args.custom_name) if args.custom_name else None
|
||||
_pkl = create_pkl_name(args.custom_name) if args.custom_name else None
|
||||
|
||||
_driving_pkl = _find_driving_pkl(_output_dir)
|
||||
if not _driving_pkl:
|
||||
print(f"No driving_tinygrad.pkl found in {_output_dir}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if _short_name:
|
||||
new_pkl = _output_dir / f"driving_{_short_name.lower()}_tinygrad.pkl"
|
||||
if _pkl:
|
||||
new_pkl = _output_dir / f"driving_{_pkl}_tinygrad.pkl"
|
||||
if not new_pkl.exists():
|
||||
_driving_pkl = _rename_pkl_with_chunks(_driving_pkl, new_pkl)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user