Comments (8)
您好,您可以使用transformers包进行加载和推理,所有的过程和其他的模型加载都一致,您可以参考这个文件。如有问题,请告知我 :)
from knowlm.
from transformers import LlamaForCausalLM,LlamaTokenizer
model = LlamaForCausalLM.from_pretrained("models/knowlm-13b-zhixi",context_length=2048,max_new_tokens=1024)
tokenizer=LlamaTokenizer.from_pretrained("models/knowlm-13b-zhixi") 您好,请问这个代码可以加载吗,我想使用显卡加载运行,还需要设置哪些参数?
from knowlm.
您好,可以的,如果您要使用gpu,请在from_pretrained方法中传入参数device_map="auto"。建议您阅读transformers包的文档来获取更多详细的说明。
如有问题请告知我 :)
from knowlm.
您好,请问这个调用里,最大上下文长度和输出文本长度如何设置,用的哪个参数?
from knowlm.
- 最大上下文长度:
这个通常在分词的时候处理,比如tokenizer(max_length=100) - 输出文本长度:
通过设置model.generate(max_new_tokens=500)来进行控制,参考代码
from knowlm.
您好,我在加载智析模型的时候显示显存不足,我的显卡是A6000,这还运行不了吗
OutOfMemoryError: CUDA out of memory. Tried to allocate 100.00 MiB (GPU 0;
47.99 GiB total capacity; 46.87 GiB already allocated; 0 bytes free; 46.87 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.
建议您使用torch_dtype=torch.bfloat16
from knowlm.
请问您还有其他问题吗?
from knowlm.
Related Issues (20)
- 环境配置pip下载不成功 HOT 2
- 使用knowlm-13b-zhix不能复现效果 HOT 4
- 复现信息抽取时运行代码报错 HOT 2
- 请问pretrain用了什么计算资源? HOT 2
- python examples/generate_lora_web.py --base_model zjunlp/knowlm-13b-zhixi命令报错 HOT 2
- TypeError: __init__() got an unexpected keyword argument 'load_in_4bit' HOT 8
- ValueError: Can't read templates/./bloom_deploy.json.json HOT 4
- lora微调为什么会出现RuntimeError: Numpy is not available HOT 1
- 请教lora微调的时候loss一直是0 HOT 5
- 从checkpoint继续lora微调报错 HOT 5
- 运行指令“python examples/generate_finetune_web.py --base_model zjunlp/knowlm-13b-base-v1.0”出现"嗯… 无法访问此页面网址为http://0.0.0.0:7860/ 的页面可能存在问题,或者已永久移动到新的网址。"报错 HOT 7
- 在执行“python examples/generate_lora_web.py --base_model knowlm-13b-zhixi”进行基于web的交互效果测试时,输入instruction和input,点击submit之后,output总是出现Error的报错,并且python的运行终端直接结束运行。运行截图如下图: HOT 24
- 按照官网的方式搞的,但是答案无法输出。 HOT 6
- 关于vllm服务部署oneke模型 参数设置问题 HOT 4
- 请问我执行generate_lora.py文件抽取三元组时候非常耗时,这种情况正常吗? HOT 2
- 单机多卡lora微调模型的显卡利用率交替 HOT 1
- 微调Qwen模型失败 HOT 2
- 关于baseline HOT 2
- 可以在不联网的状态下运行这个模型吗? HOT 10
- 在复现信息抽取的结果遇到一系列问题
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.