DeepSpeed-MII icon indicating copy to clipboard operation
DeepSpeed-MII copied to clipboard

Is openai compatible server still working?

Open RobinQu opened this issue 1 year ago • 1 comments

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:

  • Extra deps are not included, but needed: shortuuid, uvicorn, ...
  • pydantic related. See logs below.
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

RobinQu avatar Apr 15 '24 08:04 RobinQu

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

That's worked for me.

joeking11829 avatar May 14 '24 07:05 joeking11829