开发者社区 > ModelScope模型即服务 > 正文

ModelScope中,在使用awq量化qwen2 72b的时候遇到了以上问题,怎么解决?

"Traceback (most recent call last):
File ""/root/swift/swift_new/lib/python3.11/site-packages/swift/cli/export.py"", line 5, in
export_main()
File ""/root/swift/swift_new/lib/python3.11/site-packages/swift/utils/run_utils.py"", line 27, in x_main
result = llm_x(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^
File ""/root/swift/swift_new/lib/python3.11/site-packages/swift/llm/export.py"", line 109, in llm_export
awq_model_quantize(model, template.tokenizer)
File ""/root/swift/swift_new/lib/python3.11/site-packages/swift/llm/export.py"", line 71, in awq_model_quantize
awq_model.quantize(tokenizer, quant_config=quant_config)
File ""/root/swift/swift_new/lib/python3.11/site-packages/torch/utils/_contextlib.py"", line 115, in decorate_context
return func(*args,
kwargs)
^^^^^^^^^^^^^^^^^^^^^
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/models/base.py"", line 186, in quantize
self.quantizer.quantize()
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/quantize/quantizer.py"", line 156, in quantize
scales_list = [
^
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/quantize/quantizer.py"", line 157, in
self._search_best_scale(self.modules[i], layer)
File ""/root/swift/swift_new/lib/python3.11/site-packages/torch/utils/_contextlib.py"", line 115, in decorate_context
return func(*args,
kwargs)
^^^^^^^^^^^^^^^^^^^^^
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/quantize/quantizer.py"", line 277, in _search_best_scale
best_scales = self._compute_best_scale(
^^^^^^^^^^^^^^^^^^^^^^^^^
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/quantize/quantizer.py"", line 334, in _compute_best_scale
self.pseudo_quantize_tensor(fc.weight.data)[0] / scales_view
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ""/root/swift/swift_new/lib/python3.11/site-packages/awq/quantize/quantizer.py"", line 69, in pseudo_quantize_tensor
assert torch.isnan(w).sum() == 0
^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError ModelScope中,在使用awq量化qwen2 72b的时候遇到了以上问题,怎么解决? "

展开
收起
小小爱吃香菜 2024-06-19 08:41:55 125 0
2 条回答
写回答
取消 提交回答
  • 修复途径
    1.去autoawq官方源码安装最新的库
    2.transformers更新到4.41.2

    2024-07-06 15:32:32
    赞同 展开评论 打赏
  • 你好,请问这个问题解决了,我同样遇到。

    2024-07-05 18:06:36
    赞同 展开评论 打赏

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载