piece must not include null character. 报错代码import torchfrom PIL import Imagefrom transformers import AutoTokenizer, AutoModelimport torchvision.transforms as transformsmodel_name /data/feature/lbg/models/SJY-1995_GeoTikzBridge-Base-8Btokenizer AutoTokenizer.from_pretrained(model_name,trust_remote_codeTrue)model AutoModel.from_pretrained(model_name,torch_dtypetorch.bfloat16,trust_remote_codeTrue,device_mapauto)def load_image(image_path):image Image.open(image_path).convert(RGB)transform transforms.Compose([transforms.Resize((448, 448)),transforms.ToTensor(),transforms.Normalize(mean[0.485, 0.456, 0.406], std[0.229, 0.224, 0.225])])return transform(image).unsqueeze(0).to(model.device)image_tensor load_image(/data/lbg/project/hunyuan/Hunyuan3D-Part/jihe_img/a14.png)question image\nGenerate TikZ code for this geometric figure.response model.chat(tokenizer,image_tensor,question,generation_config{max_new_tokens:4096,do_sample:False})print(response)/data/feature/lbg/envs/py310/bin/python /data/lbg/project/hunyuan/Hunyuan3D-Part/geo_tak_demo.py/data/feature/lbg/envs/py310/lib/python3.10/site-packages/transformers/utils/hub.py:124: FutureWarning: Using TRANSFORMERS_CACHE is deprecated and will be removed in v5 of Transformers. Use HF_HOME instead.warnings.warn(Traceback (most recent call last):File /data/lbg/project/hunyuan/Hunyuan3D-Part/geo_tak_demo.py, line 8, in moduletokenizer AutoTokenizer.from_pretrained(File /data/feature/lbg/envs/py310/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py, line 865, in from_pretrainedreturn tokenizer_class.from_pretrained(File /data/feature/lbg/envs/py310/lib/python3.10/site-packages/transformers/tokenization_utils_base.py, line 2110, in from_pretrainedreturn cls._from_pretrained(File /data/feature/lbg/envs/py310/lib/python3.10/site-packages/transformers/tokenization_utils_base.py, line 2336, in _from_pretrainedtokenizer cls(*init_inputs, **init_kwargs)File /root/.cache/huggingface/modules/transformers_modules/SJY-1995_GeoTikzBridge-Base-8B/tokenization_internlm2.py, line 68, in __init__self.sp_model.Load(vocab_file)File /data/feature/lbg/envs/py310/lib/python3.10/site-packages/sentencepiece/__init__.py, line 209, in Loadreturn self.LoadFromFile(model_file)File /data/feature/lbg/envs/py310/lib/python3.10/site-packages/sentencepiece/__init__.py, line 213, in LoadFromFilereturn self._processor.LoadFromFile(filename)RuntimeError: INTERNAL: piece must not include null character.解决方法pip install sentencepiece0.1.99

相关新闻

零基础极速上手:用AI建站工具10分钟生成一个可备案的企业官网

零基础极速上手:用AI建站工具10分钟生成一个可备案的企业官网

如果你完全不懂技术,也没接触过网站建设,但又急需一个专业、合规的企业官网,这篇教程就是为你准备的。我们将抛开所有复杂的术语,模拟一个真实的操作流程,带你体验如何用AI建站工具,在10分钟内生成一个具备…

2026/7/22 16:43:57
计算机Python毕设实战-基于Python的医院挂号预约与诊疗记录管理系统 便民医疗在线预约挂号信息管理平台【完整源码+LW+部署说明+演示视频,全bao一条龙等】

计算机Python毕设实战-基于Python的医院挂号预约与诊疗记录管理系统 便民医疗在线预约挂号信息管理平台【完整源码+LW+部署说明+演示视频,全bao一条龙等】

博主介绍:✌️码农一枚 ,专注于大学生项目实战开发、讲解和毕业🚢文撰写修改等。全栈领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java、小程序技术领域和毕业项目实战 ✌️技术范围:&am…

2026/7/22 16:43:57
计算机Python毕设实战-智慧医疗预约挂号与智能诊断服务平台 基于 Django 的在线问诊预约与诊疗辅助系统【完整源码+LW+部署说明+演示视频,全bao一条龙等】

计算机Python毕设实战-智慧医疗预约挂号与智能诊断服务平台 基于 Django 的在线问诊预约与诊疗辅助系统【完整源码+LW+部署说明+演示视频,全bao一条龙等】

博主介绍:✌️码农一枚 ,专注于大学生项目实战开发、讲解和毕业🚢文撰写修改等。全栈领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java、小程序技术领域和毕业项目实战 ✌️技术范围:&am…

2026/7/22 16:43:57

本月热点