ucaslcl commited on
Commit
feafc74
1 Parent(s): 18a1b8a

Update modeling_GOT.py

Browse files
Files changed (1) hide show
  1. modeling_GOT.py +3 -3
modeling_GOT.py CHANGED
@@ -12,7 +12,7 @@ from .got_vision_b import build_GOT_vit_b
12
  from torchvision import transforms
13
  from torchvision.transforms.functional import InterpolationMode
14
  import dataclasses
15
- from megfile import smart_open
16
 
17
  DEFAULT_IMAGE_TOKEN = "<image>"
18
  DEFAULT_IMAGE_PATCH_TOKEN = '<imgpad>'
@@ -666,7 +666,7 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
666
  lines = lines.split("const text =")
667
  new_web = lines[0] + gt + lines[1]
668
 
669
- with smart_open(html_path_2, 'w') as web_f_new:
670
  web_f_new.write(new_web)
671
  return response_str
672
 
@@ -875,7 +875,7 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
875
  lines = lines.split("const text =")
876
  new_web = lines[0] + 'const text =' + gt + lines[1]
877
 
878
- with smart_open(html_path_2, 'w') as web_f_new:
879
  web_f_new.write(new_web)
880
 
881
  return response_str
 
12
  from torchvision import transforms
13
  from torchvision.transforms.functional import InterpolationMode
14
  import dataclasses
15
+
16
 
17
  DEFAULT_IMAGE_TOKEN = "<image>"
18
  DEFAULT_IMAGE_PATCH_TOKEN = '<imgpad>'
 
666
  lines = lines.split("const text =")
667
  new_web = lines[0] + gt + lines[1]
668
 
669
+ with open(html_path_2, 'w') as web_f_new:
670
  web_f_new.write(new_web)
671
  return response_str
672
 
 
875
  lines = lines.split("const text =")
876
  new_web = lines[0] + 'const text =' + gt + lines[1]
877
 
878
+ with open(html_path_2, 'w') as web_f_new:
879
  web_f_new.write(new_web)
880
 
881
  return response_str