Comments (5)
您好,只需要在运行命令前加上``CUDA_VISIBLE_DEVICES=...`即可,比如您希望在卡0和卡2上进行运行,则运行下面的命令:
CUDA_VISIBLE_DEVICES=0,2 python examples/generate_finetune_web.py --base_model zjunlp/knowlm-13b-base-v1.0
如有其他问题,请告知我 :)
from knowlm.
请问您的问题是否已解决?
from knowlm.
谢谢您!问题仍未解决。我用了拥有的4张卡,还是类似的报错:
(knowlm) me@ubuntugpu:~/KnowLM$ CUDA_VISIBLE_DEVICES=0,1,2,3 python examples/generate_lora.py --base_model zjunlp/knowlm-13b-zhixi --run_ie_cases
testing ie ablities!
load_8bit=False
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:20<00:00, 6.88s/it]
instruction: 我将给你个输入,请根据事件类型列表:['旅游行程'],论元角色列表:['旅游地点', '旅游时间', '旅游人员'],从输入中抽取出可能包含的事件,并以(事件触发词,事件类型,[(事件论元,论元角色)])的形式回答。
input: John昨天在纽约的咖啡馆见到了他的朋友Merry。他们一起喝咖啡聊天,计划着下周去加利福尼亚(California)旅行。他们决定一起租车并预订酒店。他们先计划在下周一去圣弗朗西斯科参观旧金山大桥,下周三去洛杉矶拜访Merry的父亲威廉。
GenerationConfig {
"num_beams": 4,
"repetition_penalty": 1.3,
"temperature": 0.2,
"top_k": 40,
"top_p": 0.75,
"transformers_version": "4.28.1"
}
Traceback (most recent call last):
File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 217, in <module>
fire.Fire(main)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 212, in main
print(evaluate(instruction, num_beams=cfg["num_beams"], temperature=cfg["temperature"], repetition_penalty=cfg["repetition_penalty"]))
File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 193, in evaluate
generation_output = model.generate(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/transformers/generation/utils.py", line 1524, in generate
return self.beam_search(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/transformers/generation/utils.py", line 2810, in beam_search
outputs = self(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/hooks.py", line 166, in new_forward
return module._hf_hook.post_forward(module, output)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/hooks.py", line 285, in post_forward
output = send_to_device(output, self.input_device)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 133, in send_to_device
return recursively_apply(_send_to_device, tensor, device, non_blocking, test_type=_has_to_method)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 93, in recursively_apply
{
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 94, in <dictcomp>
k: recursively_apply(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 82, in recursively_apply
return honor_type(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 53, in honor_type
return type(obj)(generator)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 85, in <genexpr>
recursively_apply(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 82, in recursively_apply
return honor_type(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 53, in honor_type
return type(obj)(generator)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 85, in <genexpr>
recursively_apply(
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 101, in recursively_apply
return func(data, *args, **kwargs)
File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 126, in _send_to_device
return t.to(device, non_blocking=non_blocking)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 10.75 GiB total capacity; 9.45 GiB already allocated; 5.62 MiB free; 9.91 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
from knowlm.
您好,运行时请尝试添加--load_8bit,如有其他问题,请告知我 :)
from knowlm.
您好,建议您先使用nvidia-smi
或者gpustat
命令查看一下4张卡是否都有充足的显存(尽量保证四张卡剩余的显存相同),运行13B的模型至少需要26GB的显存,对于使用beam search
方式,可能需要占用更多的显存。如有其他问题,请告知我 :)
from knowlm.
Related Issues (20)
- 关于knowLM的使用 HOT 7
- 环境配置 HOT 5
- 模型量化 HOT 8
- 请教KnowLM、IEPile和DeepKE-LLM三者之间的关系 HOT 3
- 模型评估 HOT 7
- 请问一下lora指令微调knowlm可以用中文数据集吗?我用中文的会报错,改成英文就不会 HOT 4
- 是否有Dialogue Model这类信息抽取模型在常用IE数据集上的评测结果,如准确率,F1呢 HOT 2
- 大规模数据读取费时 HOT 2
- 关于Lora指令微调权重获取与复原,这一部分的链接好像有问题,https://github.com/zjunlp/KnowLM/tree/main#22-%E9%A2%84%E8%AE%AD%E7%BB%83%E6%A8%A1%E5%9E%8B%E6%9D%83%E9%87%8D%E8%8E%B7%E5%8F%96%E4%B8%8E%E6%81%A2%E5%A4%8D HOT 7
- 实体在Wikidata中对应的ID HOT 1
- 二次训练 HOT 4
- 您好,我想在自己的数据集上对经过llama.cpp量化的zhixi大模型进行评估,我应该怎么做,能否给出一些指导,非常感谢您的帮助。 HOT 4
- 评价指标Rouge HOT 2
- 下载zip解压,按步骤操作,报OSError HOT 3
- 求助:由于在国内使用阿里云服务器,无法科学上网接入huggingface下载模型,通过魔塔下载好模型后运行,代码有报错 HOT 5
- generate_lora_web.py报错求助 HOT 5
- 训练数据集 HOT 4
- 模型加载 HOT 8
- 环境配置pip下载不成功 HOT 2
- 使用knowlm-13b-zhix不能复现效果 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knowlm.