Skip to content

Commit 640eacc

Browse files
committed
fix encoding intern-video
1 parent 1adde2c commit 640eacc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notebooks/intern-video2-classiciation/ov_internvideo_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def patch_model_code(model_dir):
620620
orig_modeling_file = model_dir / "orig_modeling_internvideo2.py"
621621
if not orig_modeling_file.exists():
622622
modeling_file.rename(orig_modeling_file)
623-
with orig_modeling_file.open("r") as in_f:
623+
with orig_modeling_file.open("r", encoding="utf-8") as in_f:
624624
content = in_f.read()
625625
content = content.replace(
626626
"self.tokenizer = BertTokenizer.from_pretrained(self._config.model.text_encoder.pretrained, local_files_only=True, use_safetensors=True)",
@@ -637,7 +637,7 @@ def patch_model_code(model_dir):
637637
config_file = model_dir / "config.json"
638638
if not orig_config_file.exists():
639639
config_file.rename(orig_config_file)
640-
with orig_config_file.open("r") as in_f:
640+
with orig_config_file.open("r", encoding="utf-8") as in_f:
641641
content = in_f.read()
642642
configs_dir = model_dir / "configs"
643643
content = content.replace('"configs/', f'"{configs_dir.absolute()}/')

0 commit comments

Comments
 (0)