fastllm icon indicating copy to clipboard operation
fastllm copied to clipboard

添加代码后运行报错,这是为什么

Open renllll opened this issue 1 year ago • 9 comments

Traceback (most recent call last):
File "web_demo3.py", line 9, in <module>
model = llm.from_hf(model, tokenizer, dtype = "float16") # dtype支持 "float16", "int8", "int4"
File "/home/remotesense/anaconda3/envs/glm/lib/python3.8/site-packages/fastllm_pytools-0.0.1-py3.8.egg/fastllm_pytools/llm.py", line 94, in from_hf
return hf_model.create(model, tokenizer, dtype = dtype); File "/home/remotesense/anaconda3/envs/glm/lib/python3.8/site-packages/fastllm_pytools-0.0.1-py3.8.egg/fastllm_pytools/hf_model.py", line 84, in create if len(active_adapter) != 0: TypeError: object of type 'method' has no len()

renllll avatar Sep 06 '23 06:09 renllll

我的model.active_adapter是一个方法,而84行附近却是调用数值,这该如何解决

renllll avatar Sep 06 '23 16:09 renllll

active_adapter = "" if hasattr(model, "active_adapter"): try: active_adapter = model.active_adapter() except ValueError: print("No adapter loaded.") 我将源代码修改成以上后,报以下错误 No adapter loaded. convert ( 200 / 200 ) Warmup... status = 7 1 16 128 Error: cublas error. terminate called after throwing an instance of 'char const*' Aborted (core dumped)

renllll avatar Sep 06 '23 17:09 renllll

一样的情况,相同代码,centos下无问题,在WSL2中的ubuntu编译后出现该问题

ImmNaruto avatar Sep 07 '23 06:09 ImmNaruto

一样的情况,相同代码,centos下无问题,在WSL2中的ubuntu编译后出现该问题

这是编译时的问题,还是代码本身问题,后面报错是显存爆了,我在源代码中更改了下

renllll avatar Sep 08 '23 03:09 renllll

尝试tramsformer版本改低点试试呢,我们这边4.33.0也遇到这问题,改成4.31.0就好了

ChanChiChoi avatar Sep 12 '23 03:09 ChanChiChoi

尝试tramsformer版本改低点试试呢,我们这边4.33.0也遇到这问题,改成4.31.0就好了

No adapter loaded. convert ( 200 / 200 ) Warmup... status = 7 1 16 128 Error: cublas error. terminate called after throwing an instance of 'char const*' Aborted (core dumped) 但是这个报错没法解决

renllll avatar Sep 13 '23 08:09 renllll

User:你好 Error: cublas error. Aborted (core dumped)

直接报错,这是因为啥呢,cuda117环境

ARES3366 avatar Sep 14 '23 07:09 ARES3366

同样错误

Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:12<00:00,  1.82s/it]
Traceback (most recent call last):
  File "/Users/Maximin/Downloads/fastllm/build/tools/test.py", line 14, in <module>
    model = llm.from_hf(
  File "/Users/Maximin/Downloads/fastllm/build/tools/fastllm_pytools/llm.py", line 161, in from_hf
    return hf_model.create(model, tokenizer, dtype=dtype)
  File "/Users/Maximin/Downloads/fastllm/build/tools/fastllm_pytools/hf_model.py", line 84, in create
    if len(active_adapter) != 0:
TypeError: object of type 'method' has no len()
Illegal instruction: 4

failable avatar Sep 20 '23 10:09 failable

同样报错,transformer==4.33.2

128Ghe980 avatar Oct 13 '23 11:10 128Ghe980