Qwen2-VL部署pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for

 部署阿里云团队的Qwen2-VL大模型发生报错如下:

模型为GPTQ-int8     计算卡为P40Qwen/Qwen2-VL-7B-Instruct-GPTQ-Int8 · Hugging Faceicon-default.png?t=O83Ahttps://huggingface.co/Qwen/Qwen2-VL-7B-Instruct-GPTQ-Int8

 虚拟环境各py包如下:

(qwen2vl) PS C:\Users\Administrator> pip list
Package                       Version
----------------------------- ------------
accelerate                    0.34.2
aiofiles                      23.2.1
aiohappyeyeballs              2.4.0
aiohttp                       3.10.5
aiosignal                     1.3.1
altair                        5.4.1
annotated-types               0.7.0
anyio                         4.4.0
async-timeout                 4.0.3
attrs                         24.2.0
auto_gptq                     0.7.1+cu118
autoawq                       0.2.6
autoawq_kernels               0.0.7
av                            13.0.0
certifi                       2024.8.30
charset-normalizer            3.3.2
click                         8.1.7
colorama                      0.4.6
coloredlogs                   15.0.1
contourpy                     1.3.0
cycler                        0.12.1
datasets                      2.21.0
dill                          0.3.8
einops                        0.8.0
exceptiongroup                1.2.2
fastapi                       0.114.1
ffmpy                         0.4.0
filelock                      3.13.1
fonttools                     4.53.1
frozenlist                    1.4.1
fsspec                        2024.2.0
gekko                         1.2.1
gradio                        4.29.0
gradio_client                 0.16.1
h11                           0.14.0
httpcore                      1.0.5
httpx                         0.27.2
huggingface-hub               0.24.6
humanfriendly                 10.0
idna                          3.8
importlib_resources           6.4.5
intel-openmp                  2021.4.0
Jinja2                        3.1.3
jsonschema                    4.23.0
jsonschema-specifications     2023.12.1
kiwisolver                    1.4.7
markdown-it-py                3.0.0
MarkupSafe                    2.1.5
matplotlib                    3.9.2
mdurl                         0.1.2
mkl                           2021.4.0
mpmath                        1.3.0
multidict                     6.1.0
multiprocess                  0.70.16
narwhals                      1.6.4
networkx                      3.2.1
ninja                         1.11.1.1
numpy                         1.26.3
optimum                       1.22.0
orjson                        3.10.7
packaging                     24.1
pandas                        2.2.2
peft                          0.12.0
pillow                        10.2.0
pip                           24.2
protobuf                      5.28.0
psutil                        6.0.0
pyarrow                       17.0.0
pydantic                      2.9.1
pydantic_core                 2.23.3
pydub                         0.25.1
Pygments                      2.18.0
pyparsing                     3.1.4
pyreadline3                   3.4.3
python-dateutil               2.9.0.post0
python-multipart              0.0.9
pytz                          2024.2
PyYAML                        6.0.2
qwen-vl-utils                 0.0.2
referencing                   0.35.1
regex                         2024.7.24
requests                      2.32.3
rich                          13.8.1
rouge                         1.0.1
rpds-py                       0.20.0
ruff                          0.6.4
safetensors                   0.4.5
semantic-version              2.10.0
sentencepiece                 0.2.0
setuptools                    72.1.0
shellingham                   1.5.4
six                           1.16.0
sniffio                       1.3.1
### 解决 Qwen2.5-VL 中 `_queue.Empty` 错误 当遇到 `Qwen2.5-VL` 的 `_queue.Empty` 错误时,通常意味着程序尝试从队列中获取数据但该队列为空。此错误可能发生在多线程或多进程环境中,特别是在处理异步操作或并发访问共享资源的情况下。 为了有效解决这一问题,可以采取以下几种方法: #### 1. 增加超时机制 通过设置合理的等待时间来防止立即抛出异常,允许更多的时间让其他线程填充队列。 ```python import queue try: item = q.get(timeout=5) # 设置5秒的超时时间 except queue.Empty: print('Queue is empty, no items to process.') ``` #### 2. 使用轮询方式检查队列状态 定期检查队列是否含有待处理项,在确认有可用条目后再执行取出动作。 ```python while True: try: if not q.empty(): item = q.get_nowait() break time.sleep(0.1) # 防止CPU占用过高 except queue.Empty: continue ``` #### 3. 调整生产者消费者比例 如果发现频繁出现空队列的情况,则可能是由于消费者的消费速度远超过生产者的生产能力所造成的。此时应考虑调整两者之间的平衡关系,比如增加生产者数量或者减少消费者数目等措施[^1]。 #### 4. 检查逻辑流程 确保所有负责向队列添加项目的部分正常工作,并且没有任何地方意外地中止了这些过程;同时也要验证是否存在某些条件下会跳过入队操作的情形。 以上方案可以帮助缓解乃至彻底消除因 `_queue.Empty` 导致的问题。具体实施哪种策略取决于实际应用场景以及系统的整体架构设计需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

光芒再现dev

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值