InternLM / lmdeploy

LMDeploy is a toolkit for compressing, deploying, and serving LLMs.
https://lmdeploy.readthedocs.io/en/latest/
Apache License 2.0
4.35k stars 390 forks source link

[Bug] argparse.ArgumentError: argument command: conflicting subparser: chat #1396

Closed zcg-joker closed 5 months ago

zcg-joker commented 6 months ago

Checklist

Describe the bug

运行控制台交互式对话命令lmdeploy chat /root/share/model_repos/internlm2-chat-7b 报错如下: image

Reproduction

lmdeploy chat /root/share/model_repos/internlm2-chat-7b

Environment

终端运行lmdeploy check_env也报相同的错误
Traceback (most recent call last):
  File "/root/.conda/bin/lmdeploy", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/root/.conda/lib/python3.11/site-packages/lmdeploy/cli/entrypoint.py", line 19, in run
    CLI.add_parser_chat()
  File "/root/.conda/lib/python3.11/site-packages/lmdeploy/cli/cli.py", line 81, in add_parser_chat
    parser = CLI.subparsers.add_parser(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.conda/lib/python3.11/argparse.py", line 1192, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument command: conflicting subparser: chat

lmdeploy版本为0.3.0

Error traceback

Traceback (most recent call last):
  File "/root/.conda/bin/lmdeploy", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/root/.conda/lib/python3.11/site-packages/lmdeploy/cli/entrypoint.py", line 19, in run
    CLI.add_parser_chat()
  File "/root/.conda/lib/python3.11/site-packages/lmdeploy/cli/cli.py", line 81, in add_parser_chat
    parser = CLI.subparsers.add_parser(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.conda/lib/python3.11/argparse.py", line 1192, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument command: conflicting subparser: chat
zhulinJulia24 commented 6 months ago

It seems occurs in python 3.11 version. If you are in a hurry, you can try it on python 3.10, it works fine on python 3.10.

zcg-joker commented 6 months ago

It seems occurs in python 3.11 version. If you are in a hurry, you can try it on python 3.10, it works fine on python 3.10.

Thank you, i will try it

RunningLeon commented 6 months ago

Let me reproduce the issue and see if there's a good solution for py311.

RunningLeon commented 6 months ago

@zcg-joker Hi, sorry for the trouble. If you have time, could try pr #1401.

NickLennonLiu commented 5 months ago

大哥,是不是只修了chat没修serve啊

RunningLeon commented 5 months ago

大哥,是不是只修了chat没修serve啊

serve 不会有这个问题的。 你这边有问题的话,可以给下版本和复现代码

lvhan028 commented 5 months ago

closing it since no more activities. Feel free to reopen it if it is still an issue