From 5d914f68f5663efe04a753c849d6f37d223b794c Mon Sep 17 00:00:00 2001 From: Thomas Parnell Date: Tue, 21 Jan 2025 09:56:03 +0100 Subject: [PATCH 1/2] use_existing_torch.py: filter out comments Signed-off-by: Thomas Parnell --- use_existing_torch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/use_existing_torch.py b/use_existing_torch.py index 319d26289..4138b93e6 100644 --- a/use_existing_torch.py +++ b/use_existing_torch.py @@ -6,6 +6,8 @@ print(f">>> cleaning {file}") with open(file) as f: lines = f.readlines() + # filter out comments + lines = [ line.split(" #")[0] for line in lines ] if "torch" in "".join(lines).lower(): print("removed:") with open(file, 'w') as f: From cba95f48ab510acee20bdd01a1db660481aa8a0d Mon Sep 17 00:00:00 2001 From: Thomas Parnell Date: Tue, 21 Jan 2025 10:11:43 +0100 Subject: [PATCH 2/2] fmt Signed-off-by: Thomas Parnell --- use_existing_torch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use_existing_torch.py b/use_existing_torch.py index 4138b93e6..1dc780950 100644 --- a/use_existing_torch.py +++ b/use_existing_torch.py @@ -7,7 +7,7 @@ with open(file) as f: lines = f.readlines() # filter out comments - lines = [ line.split(" #")[0] for line in lines ] + lines = [line.split(" #")[0] for line in lines] if "torch" in "".join(lines).lower(): print("removed:") with open(file, 'w') as f: