From 3e1799fb15f40dc501e848dc6b4242dcdc9dc900 Mon Sep 17 00:00:00 2001 From: i-peixingyu Date: Tue, 7 Jul 2026 11:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20NV=20A100=20Patched=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F/patch.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NV A100 Patched 镜像/patch.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 NV A100 Patched 镜像/patch.py diff --git a/NV A100 Patched 镜像/patch.py b/NV A100 Patched 镜像/patch.py deleted file mode 100644 index e8109ca..0000000 --- a/NV A100 Patched 镜像/patch.py +++ /dev/null @@ -1,19 +0,0 @@ -path = '/usr/local/lib/python3.12/dist-packages/transformers/tokenization_utils_base.py' -with open(path, 'r') as f: - content = f.read() - -old = (' self.SPECIAL_TOKENS_ATTRIBUTES = self.SPECIAL_TOKENS_ATTRIBUTES' - ' + list(special_tokens.keys())') -new = (' # PATCH: some models have extra_special_tokens as list instead of dict\n' - ' if isinstance(special_tokens, list):\n' - ' special_tokens = {t: t for t in special_tokens}\n' - ' self.SPECIAL_TOKENS_ATTRIBUTES = self.SPECIAL_TOKENS_ATTRIBUTES' - ' + list(special_tokens.keys())') - -if old in content: - content = content.replace(old, new) - with open(path, 'w') as f: - f.write(content) - print('Patch applied successfully') -else: - print('WARNING: pattern not found') \ No newline at end of file