Skip to content

report error while i execute python -m fastchat.serve.openai_api_server --host localhost --port 8000 #1641

@lplzyp

Description

@lplzyp

1,already execute git pull
2,web model and cli mode works
3,it reports error below:
/root/anaconda3/envs/fastchat/lib/python3.9/runpy.py:197 in _run_module_as_main │
│ │
│ 194 │ main_globals = sys.modules["main"].dict
│ 195 │ if alter_argv: │
│ 196 │ │ sys.argv[0] = mod_spec.origin │
│ ❱ 197 │ return _run_code(code, main_globals, None, │
│ 198 │ │ │ │ │ "main", mod_spec) │
│ 199 │
│ 200 def run_module(mod_name, init_globals=None, │
│ │
│ /root/anaconda3/envs/fastchat/lib/python3.9/runpy.py:87 in _run_code │
│ │
│ 84 │ │ │ │ │ loader = loader, │
│ 85 │ │ │ │ │ package = pkg_name, │
│ 86 │ │ │ │ │ spec = mod_spec) │
│ ❱ 87 │ exec(code, run_globals) │
│ 88 │ return run_globals │
│ 89 │
│ 90 def _run_module_code(code, init_globals=None, │
│ │
│ /home/work/FastChat/fastchat/serve/openai_api_server.py:34 in │
│ │
│ 31 from fastchat.constants import WORKER_API_TIMEOUT, WORKER_API_EMBEDDING_BATCH_SIZE, Erro │
│ 32 from fastchat.model.model_adapter import get_conversation_template │
│ 33 from fastapi.exceptions import RequestValidationError │
│ ❱ 34 from fastchat.protocol.openai_api_protocol import ( │
│ 35 │ ChatCompletionRequest, │
│ 36 │ ChatCompletionResponse, │
│ 37 │ ChatCompletionResponseStreamChoice, │
│ │
│ /home/work/FastChat/fastchat/protocol/openai_api_protocol.py:70 in │
│ │
│ 67 │ content: str │
│ 68 │
│ 69 │
│ ❱ 70 class ChatCompletionResponseChoice(BaseModel): │
│ 71 │ index: int │
│ 72 │ message: ChatMessage │
│ 73 │ finish_reason: Optional[Literal["stop", "length"]] │
│ │
│ in pydantic.main.ModelMetaclass.new:197 │
│ │
│ in pydantic.fields.ModelField.infer:506 │
│ │
│ in pydantic.fields.ModelField.init:436 │
│ │
│ in pydantic.fields.ModelField.prepare:552 │
│ │
│ in pydantic.fields.ModelField._type_analysis:661 │
│ │
│ in pydantic.fields.ModelField._type_analysis:668 │
│ │
│ /root/anaconda3/envs/fastchat/lib/python3.9/typing.py:852 in subclasscheck
│ │
│ 849 │ │ if isinstance(cls, _SpecialGenericAlias): │
│ 850 │ │ │ return issubclass(cls.origin, self.origin) │
│ 851 │ │ if not isinstance(cls, _GenericAlias): │
│ ❱ 852 │ │ │ return issubclass(cls, self.origin) │
│ 853 │ │ return super().subclasscheck(cls) │
│ 854 │ │
│ 855 │ def reduce(self):

How can I fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions