InternLM-XComposer
InternLM-XComposer copied to clipboard
最新的2d5模型使用huggingface上的示例下载(model = AutoModel.from_pretrained('internlm/internlm-xcomposer2d5-7b', torch_dtype=torch.bfloat16, trust_remote_code=True).cuda().eval()),不会下载build_mlp.py文件,有没有遇到这个情况的
找到问题了,在ixc_utils.py中:def get_font():
truetype_url = 'https://huggingface.co/internlm/internlm-xcomposer2d5-7b/resolve/main/SimHei.ttf?download=true'
ff = urlopen(truetype_url)
font = ImageFont.truetype(ff, size=40)
return font
需要把truetype_url = 'https://huggingface.co/internlm/internlm-xcomposer2d5-7b/resolve/main/SimHei.ttf?download=true'这里的url改为SimHei.ttf路径如下: def get_font(): # 使用本地字体文件路径 font_path = 'your path/SimHei.ttf' font = ImageFont.truetype(font_path, size=40) return font
感谢感谢