ucaslcl commited on
Commit
8f13284
1 Parent(s): f89d84f

Update modeling_GOT.py

Browse files
Files changed (1) hide show
  1. modeling_GOT.py +5 -3
modeling_GOT.py CHANGED
@@ -580,7 +580,8 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
580
  if outputs.endswith(stop_str):
581
  outputs = outputs[:-len(stop_str)]
582
  outputs = outputs.strip()
583
-
 
584
  if render:
585
  print('==============rendering===============')
586
  from .render_tools import svg_to_html, content_mmd_to_html, tik_html, translation_table
@@ -655,7 +656,7 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
655
 
656
  with smart_open(html_path_2, 'w') as web_f_new:
657
  web_f_new.write(new_web)
658
- return output_ids
659
 
660
  def dynamic_preprocess(self, image, min_num=1, max_num=6, image_size=1024, use_thumbnail=True):
661
 
@@ -818,6 +819,7 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
818
  if outputs.endswith(stop_str):
819
  outputs = outputs[:-len(stop_str)]
820
  outputs = outputs.strip()
 
821
 
822
  if render:
823
  print('==============rendering===============')
@@ -846,4 +848,4 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
846
  with smart_open(html_path_2, 'w') as web_f_new:
847
  web_f_new.write(new_web)
848
 
849
- return output_ids
 
580
  if outputs.endswith(stop_str):
581
  outputs = outputs[:-len(stop_str)]
582
  outputs = outputs.strip()
583
+ response_str = outputs
584
+
585
  if render:
586
  print('==============rendering===============')
587
  from .render_tools import svg_to_html, content_mmd_to_html, tik_html, translation_table
 
656
 
657
  with smart_open(html_path_2, 'w') as web_f_new:
658
  web_f_new.write(new_web)
659
+ return response_str
660
 
661
  def dynamic_preprocess(self, image, min_num=1, max_num=6, image_size=1024, use_thumbnail=True):
662
 
 
819
  if outputs.endswith(stop_str):
820
  outputs = outputs[:-len(stop_str)]
821
  outputs = outputs.strip()
822
+ response_str = outputs
823
 
824
  if render:
825
  print('==============rendering===============')
 
848
  with smart_open(html_path_2, 'w') as web_f_new:
849
  web_f_new.write(new_web)
850
 
851
+ return response_str