microsoft / DeepSpeed-MII

MII makes low-latency and high-throughput inference possible, powered by DeepSpeed.
Apache License 2.0
1.76k stars 163 forks source link

Is openai compatible server still working? #459

Open RobinQu opened 2 months ago

RobinQu commented 2 months ago

In a fresh conda env, ater pip install, the following command (mentioned in this PR) is no longer working.

python -m mii.entrypoints.openai_api_server     --model "mistralai/Mistral-7B-Instruct-v0.1"     --port 3000     --host 0.0.0.0

There are at least problems:

python -m mii.entrypoints.openai_api_server     --model "mistralai/Mistral-7B-Instruct-v0.1"     --port 3000     --host 0.0.0.0
[2024-04-15 15:55:20,541] [INFO] [real_accelerator.py:191:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspace/envs/deepspeed/lib/python3.11/site-packages/mii/entrypoints/openai_api_server.py", line 31, in <module>
    from .data_models import (
  File "/workspace/envs/deepspeed/lib/python3.11/site-packages/mii/entrypoints/data_models.py", line 12, in <module>
    from pydantic import BaseModel, BaseSettings, Field
  File "/workspace/envs/deepspeed/lib/python3.11/site-packages/pydantic/__init__.py", line 380, in __getattr__
    return _getattr_migration(attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/envs/deepspeed/lib/python3.11/site-packages/pydantic/_migration.py", line 296, in wrapper
    raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.7/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.7/u/import-error
joeking11829 commented 1 month ago

Use python3 -m pip install "pydantic==1.*" fastapi shortuuid fastchat to install deps.

That's worked for me.