hcgf icon indicating copy to clipboard operation
hcgf copied to clipboard

ModuleNotFoundError: No module named 'hcgf'

Open jlliushi opened this issue 3 years ago • 16 comments

import hcgf gl = hcgf.GlmLora("model", load_in_8bit=True, lora_r=32)

ModuleNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_15056\644290863.py in ----> 1 import hcgf 2 gl = hcgf.GlmLora("model", load_in_8bit=True, lora_r=32)

ModuleNotFoundError: No module named 'hcgf'

gl.load_data("./tests/test_data.json").tune()

NameError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_15056\3044540026.py in ----> 1 gl.load_data("./tests/test_data.json").tune()

NameError: name 'gl' is not defined

jlliushi avatar Apr 02 '23 00:04 jlliushi

先按README安装一下

hscspring avatar Apr 02 '23 01:04 hscspring

RuntimeError: CUDA Setup failed despite GPU being available. Inspect the CUDA SETUP outputs above to fix your environment! If you cannot find any issues and suspect a bug, please open an issue with detals about your environment: https://github.com/TimDettmers/bitsandbytes/issues

jlliushi avatar Apr 02 '23 02:04 jlliushi

如果内存足够的话可以不用8bit版本。这个包是8bit版本要安装的。

hscspring avatar Apr 02 '23 15:04 hscspring

我的显卡是4070Ti,12G的,应该用这个吧。ChatGlM-6B本地部署都好使了,还有Stable_Diffusion、codeFormer等AI程序都能运行,为什么本程序提示CUDA Setup failed呢?

jlliushi avatar Apr 03 '23 07:04 jlliushi

因为你用的是8bit模式,必须安装README里提到的依赖:bitsandbytes。 或者你就别用这种模式加载。

hscspring avatar Apr 03 '23 12:04 hscspring

我已经安装了bitsandbytes依赖呀。若卸载掉bitsandbytes,不提示CUDA Setup failed,而是提示bitsandbytes没安装;若重新安装了bitsandbytes,又提示CUDA Setup failed。我该怎么处理?

jlliushi avatar Apr 04 '23 00:04 jlliushi

把执行过程和错误都发一下看看。这个应该是你的环境哪里没弄好。

hscspring avatar Apr 04 '23 01:04 hscspring

cw

jlliushi avatar Apr 04 '23 06:04 jlliushi

建议conda隔离环境,一个环境一个项目,虽然浪费一点磁盘空间但是值得。 项目太多了,难免会A项目要2版本,B项目要3版本,又不能兼得。

zhaodice avatar Apr 04 '23 08:04 zhaodice

@jlliushi 你这个应该是 bitsandbytes 就没装好。可以试一下 import bitsandbytes 看看,bitsandbytes相关的可以参考它的文档,按照官方提示安装。看报错信息是没找到cuda,这个包是针对cuda的。

hscspring avatar Apr 04 '23 11:04 hscspring

确实是 bitsandbytes 没装好,但怎么能装好呢? 当我把 bitsandbytes 卸载后,import hcgf 就不报错了,但运行 gl = hcgf.GlmLora("model", load_in_8bit=True) 时,报 No module named 'bitsandbytes' 错误;运行 gl = hcgf.GlmLora("model", device="cuda:0") 时,只是爆显存,并未报 CUDA Setup failed 。 卸bitsandbytes 当再把 bitsandbytes 装上后,又报 CUDA Setup failed 了。 装bitsandbytes

jlliushi avatar Apr 04 '23 14:04 jlliushi

终于鼓捣好使了:Windows10系统安装 bitsandbytes 时,需要这样 pip install bitsandbytes-windows

jlliushi avatar Apr 04 '23 16:04 jlliushi

ok,Windows开发真要命。。。

hscspring avatar Apr 04 '23 17:04 hscspring

linux和windows各有各的好处吧,但我都想用,我就主系统装了Proxmox VE,然后开windows虚拟机、linux虚拟机、容器什么的,想用随时切,游戏训练两不误,想组装学习机可以参考一下~

zhaodice avatar Apr 04 '23 17:04 zhaodice

微调后对本领域问题回答完全胡说八道!在已有本领域问答对文本的情况下,如何才能令其精准回答本领域的问题呢?还有什么好办法吗?

jlliushi avatar Apr 08 '23 12:04 jlliushi

这里有两个问题:

  1. 一些简单问题微调后是能生效的,2-3轮就可以了。数据可以一定重复。不过感觉任务不能太复杂,主要是这个模型本身太小了。
  2. 要想精准有点困难,毕竟是生成式模型。有两种思路可以稍微缓解这个不确定生成的问题:第一种,先做文档召回,然后召回结果作为上下文,强制模型根据上下文回答;第二种,调整参数,调用stream_chat方法,设置tempreture和top_p,两个不要同时用。越大越随机。

hscspring avatar Apr 08 '23 15:04 hscspring