alipay / Ant-Multi-Modal-Framework

Research Code for Multimodal-Cognition Team in Ant Group
Creative Commons Attribution 4.0 International
60 stars 2 forks source link

AssertionError: either nn_name or nn_model_path has to be provided When running M2-Encode #8

Closed zhengxingmao closed 1 month ago

zhengxingmao commented 3 months ago

Running the provided M2-Encode demo example results in an error.

Ant-Multi-Modal-Framework/prj/M2_Encoder# python3 run.py 
Traceback (most recent call last):
  File "/data/IdeaProjects/Ant-Multi-Modal-Framework/prj/M2_Encoder/run.py", line 17, in <module>
    encoder.warmup_local_model()
  File "/usr/local/lib/python3.10/dist-packages/nn4k/invoker/base.py", line 192, in warmup_local_model
    model_args, *_ = parser.parse_dict(self.init_args, allow_extra_keys=True)
  File "/usr/local/lib/python3.10/dist-packages/transformers/hf_argparser.py", line 373, in parse_dict
    obj = dtype(**inputs)
  File "<string>", line 7, in __init__
  File "/usr/local/lib/python3.10/dist-packages/nn4k/executor/base.py", line 209, in __post_init__
    self.nn_name is not None or self.nn_model_path is not None
AssertionError: either nn_name or nn_model_path has to be provided
smtrnd commented 2 months ago

vi run.py image add nn_name in cfg

HanxiaoZhang commented 1 month ago

@zhengxingmao This issue can be resolved by installing a specific version using the command: pip install openspg-nn4k==0.0.2b3. We have already fixed it. https://github.com/alipay/Ant-Multi-Modal-Framework/blob/a6b512902b0e4d4721886e8751b8dcd5721f18d5/prj/M2_Encoder/requirements.txt#L24