TigerBot icon indicating copy to clipboard operation
TigerBot copied to clipboard

windos安装报错

Open gitlihua opened this issue 2 years ago • 22 comments

请问安装到最后一步报错如下: d:\TigerBot>.\python310\python.exe infer.py --model_path d:\TigerBot\model
loading model: d:\TigerBot\model... Traceback (most recent call last): File "d:\TigerBot\infer.py", line 101, in fire.Fire(main) File "d:\TigerBot\python310\lib\site-packages\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "d:\TigerBot\python310\lib\site-packages\fire\core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "d:\TigerBot\python310\lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "d:\TigerBot\infer.py", line 37, in main model = get_model(model_path) File "d:\TigerBot\infer.py", line 26, in get_model model = AutoModelForCausalLM.from_pretrained(model, torch_dtype=torch.float16) File "d:\TigerBot\python310\lib\site-packages\transformers\models\auto\auto_factory.py", line 471, in from_pretrained return model_class.from_pretrained( File "d:\TigerBot\python310\lib\site-packages\transformers\modeling_utils.py", line 2405, in from_pretrained raise EnvironmentError( OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory d:\TigerBot\model.

模型文件用的这个 图片

gitlihua avatar Jun 12 '23 01:06 gitlihua

OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory d:\TigerBot\model. 大概率路径不对,应该还要往下一层。

Tlntin avatar Jun 12 '23 01:06 Tlntin

下一层已经没有文件夹了 图片

我看视频里面也是到这一层文件夹 图片

gitlihua avatar Jun 12 '23 02:06 gitlihua

好吧。那就比较奇怪了。可以把模型放到代码里面,然后用相对路径试试。

Tlntin avatar Jun 12 '23 02:06 Tlntin

quant模型不是用infer. 而是tigerbot_infer.py,参考repo介绍哦, 前者去找pytorch_model.bin了。

chentigerye avatar Jun 12 '23 02:06 chentigerye

我把模型换成chat模型,报如下错误 图片

gitlihua avatar Jun 12 '23 05:06 gitlihua

请问解决了?我也遇到同样的问题了!

wujiankun123 avatar Jun 13 '23 10:06 wujiankun123

window没解决,不知道啥问题,我换Linux了,到最后还是报错,这个啥问题? 图片

gitlihua avatar Jun 14 '23 03:06 gitlihua

window没解决,不知道啥问题,我换Linux了,到最后还是报错,这个啥问题? 图片

什么显卡?显存多大?

Tlntin avatar Jun 14 '23 03:06 Tlntin

GPU: 1 * NVIDIA Professional Graphics Card / 1 * 16G 这个

gitlihua avatar Jun 14 '23 03:06 gitlihua

GPU: 1 * NVIDIA Professional Graphics Card / 1 * 16G 这个

显存可能不太够,这个模型差不多要16G多一点点,你至少也要留一些空闲给它。 你可以试试4bit的那个版本,8G显存就够了。

Tlntin avatar Jun 14 '23 03:06 Tlntin

换成4bit的模型也报错,再帮忙看看 图片

gitlihua avatar Jun 14 '23 04:06 gitlihua

换成4bit的模型也报错,再帮忙看看 图片

可能是环境问题,还有模型不建议放系统目录,容易有权限问题。

Tlntin avatar Jun 14 '23 11:06 Tlntin

换成4bit的模型也报错,再帮忙看看 图片

可能是环境问题,还有模型不建议放系统目录,容易有权限问题。

如果环境问题那chat模型应该运行不起来啊,这看报错应该也不是权限的问题吧

gitlihua avatar Jun 15 '23 01:06 gitlihua

quant模型不是用infer. 而是tigerbot_infer.py,参考repo介绍哦, 前者去找pytorch_model.bin了。

我问一下这个pytorch_model.bin 文件是怎么产生的,我好像没找到

gitlihua avatar Jun 15 '23 01:06 gitlihua

pytorch_model.bin

pytorch_model.bin是huggingface开发的transformers框架在加载pytorch模型的时候,默认的文件名。不过这个对你来说没啥影响。

Tlntin avatar Jun 15 '23 01:06 Tlntin

图片 问一下这个需要怎么解决?

gitlihua avatar Aug 01 '23 09:08 gitlihua

图片 问一下这个需要怎么解决?

有下载模型到对应路径吗?

Tlntin avatar Aug 01 '23 09:08 Tlntin

图片 在同一级别路径下

gitlihua avatar Aug 01 '23 09:08 gitlihua

Repository Not Found for url: https://huggingface.co/tigerbot-7b-sft/resolve/main/config.json. Please make sure you specified the correct repo_id and repo_type. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.

他这说的好像是我没有用户名和密码来访问这个地址

gitlihua avatar Aug 01 '23 09:08 gitlihua

图片 在同一级别路径下

同一级别就错了,应该是模型在TigerBot目录下。

Tlntin avatar Aug 01 '23 09:08 Tlntin

感谢 API已经跑起来了

gitlihua avatar Aug 01 '23 10:08 gitlihua

感谢 API已经跑起来了

不客气。

Tlntin avatar Aug 01 '23 10:08 Tlntin