LlamaIndex报错

文章讨论了编程中遇到的三个技术问题:1)首次运行时nltk数据包因网络问题无法下载;2)在使用深度学习模型时,由于内存设置不足引发ValueError;3)自定义LLM中topk_cpu函数不适用于Half类型,提示用户将数据移至GPU。
部署运行你感兴趣的模型镜像

1.  首次运行,from pandas.core import ( 卡住,中断后报错

File "/data/wangzhiwen/anaconda3/lib/python3.10/site-packages/llama_index/legacy/utils.py", line 65, in __init__
    nltk.data.find("tokenizers/punkt", paths=[self._nltk_data_dir])
  File "/data/wangzhiwen/anaconda3/lib/python3.10/site-packages/nltk/data.py", line 583, in find
    raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  For more information see: https://www.nltk.org/data.html

  Attempted to load tokenizers/punkt

  Searched in:
    - '/data/wangzhiwen/anaconda3/lib/python3.10/site-packages/llama_index/legacy/_static/nltk_cache'
**********************************************************************

原因:无网络,./anaconda3/lib/python3.10/site-packages/llama_index/legacy/_static/nltk_cache/tokenizers/punkt.zip包不能下载并解压,需手动下载后在该目录解压。 

2. 

ValueError: The current `device_map` had weights offloaded to the disk. Please provide an `offload_folder` for them. Alternatively, make sure you have `safetensors` installed if the model you are using offers the weights in this format.

原因:'max_memory': {1: '10GiB', 2: '10GiB'}内存设置不够。

3.  自定义LLM报错RuntimeError: "topk_cpu" not implemented for 'Half'

原因:输出在cpu上,将输入放至GPU即可(.cuda())

您可能感兴趣的与本文相关的镜像

Python3.10

Python3.10

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值