ShushengYang commited on
Commit
9f3d57e
·
1 Parent(s): ef917c8

Update tokenization_qwen.py

Browse files
Files changed (1) hide show
  1. tokenization_qwen.py +4 -0
tokenization_qwen.py CHANGED
@@ -25,6 +25,10 @@ from matplotlib.font_manager import FontProperties
25
 
26
  logger = logging.getLogger(__name__)
27
 
 
 
 
 
28
 
29
  VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken", "ttf": "SimSun.ttf"}
30
 
 
25
 
26
  logger = logging.getLogger(__name__)
27
 
28
+ if not os.path.exists("SimSun.ttf"):
29
+ logger.warning("SimSun font is required for Chinese display. Start downloading...")
30
+ print("wget https://ofasys-wlcb.oss-cn-wulanchabu.aliyuncs.com/Qwen-VL/SimSun.ttf")
31
+ os.system("wget https://ofasys-wlcb.oss-cn-wulanchabu.aliyuncs.com/Qwen-VL/SimSun.ttf")
32
 
33
  VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken", "ttf": "SimSun.ttf"}
34