vllm icon indicating copy to clipboard operation
vllm copied to clipboard

[Bug]: when curl /chat/completions, TypeError: Unable to evaluate type annotation 'Required[Union[str, Iterable[ChatCompletionContentPartTextParam]]]'.

Open youqugit opened this issue 1 year ago • 18 comments

Your current environment

The output of `python collect_env.py`
Collecting environment information...
WARNING 09-13 07:28:00 cuda.py:22] You are using a deprecated `pynvml` package. Please install `nvidia-ml-py` instead, and make sure to uninstall `pynvml`. When both of them are installed, `pynvml` will take precedence and cause errors. See https://pypi.org/project/pynvml for more information.
PyTorch version: 2.4.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.24.1
Libc version: glibc-2.31

Python version: 3.8.10 (default, Nov 14 2022, 12:59:47)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA A800 80GB PCIe
GPU 1: NVIDIA A800 80GB PCIe
GPU 2: NVIDIA A800 80GB PCIe
GPU 3: NVIDIA A800 80GB PCIe
GPU 4: NVIDIA A800 80GB PCIe
GPU 5: NVIDIA A800 80GB PCIe

Nvidia driver version: 535.129.03
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.7.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.7.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 57 bits virtual
CPU(s):                          104
On-line CPU(s) list:             0-103
Thread(s) per core:              2
Core(s) per socket:              26
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           106
Model name:                      Intel(R) Xeon(R) Gold 5320 CPU @ 2.20GHz
Stepping:                        6
Frequency boost:                 enabled
CPU MHz:                         800.000
CPU max MHz:                     3400.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4400.00
Virtualization:                  VT-x
L1d cache:                       2.4 MiB
L1i cache:                       1.6 MiB
L2 cache:                        65 MiB
L3 cache:                        78 MiB
NUMA node0 CPU(s):               0-25,52-77
NUMA node1 CPU(s):               26-51,78-103
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; Load fences, usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 invpcid_single intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq md_clear pconfig spec_ctrl intel_stibp flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.22.2
[pip3] nvidia-cublas-cu12==12.1.3.1
[pip3] nvidia-cuda-cupti-cu12==12.1.105
[pip3] nvidia-cuda-nvrtc-cu12==12.1.105
[pip3] nvidia-cuda-runtime-cu12==12.1.105
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.0.2.54
[pip3] nvidia-curand-cu12==10.3.2.106
[pip3] nvidia-cusolver-cu12==11.4.5.107
[pip3] nvidia-cusparse-cu12==12.1.0.106
[pip3] nvidia-dali-cuda110==1.20.0
[pip3] nvidia-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] nvidia-nvjitlink-cu12==12.6.68
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] nvidia-pyindex==1.0.9
[pip3] onnx==1.12.0
[pip3] pynvml==11.4.1
[pip3] pytorch-quantization==2.1.2
[pip3] pyzmq==24.0.1
[pip3] torch==2.4.0
[pip3] torch-tensorrt==1.3.0a0
[pip3] torchtext==0.13.0a0+fae8e8c
[pip3] torchvision==0.19.0
[pip3] transformers==4.44.2
[pip3] triton==3.0.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.1@3fd2b0d21cd9ec78de410fdf8aa1de840e9ad77a
vLLM Build Flags:
CUDA Archs: 5.2 6.0 6.1 7.0 7.5 8.0 8.6 9.0+PTX; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      PIX     PIX     SYS     SYS     SYS     0-25,52-77      0               N/A
GPU1    PIX      X      PIX     SYS     SYS     SYS     0-25,52-77      0               N/A
GPU2    PIX     PIX      X      SYS     SYS     SYS     0-25,52-77      0               N/A
GPU3    SYS     SYS     SYS      X      PIX     PIX     26-51,78-103    1               N/A
GPU4    SYS     SYS     SYS     PIX      X      PIX     26-51,78-103    1               N/A
GPU5    SYS     SYS     SYS     PIX     PIX      X      26-51,78-103    1               N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

Model Input Dumps

No response

🐛 Describe the bug

I installed vllm according to the documentation with python 3.8 and cuda 11.8

# Install vLLM with CUDA 11.8.
export VLLM_VERSION=0.6.1
export PYTHON_VERSION=38
pip install https://github.com/vllm-project/vllm/releases/download/v${VLLM_VERSION}/vllm-${VLLM_VERSION}+cu118-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-manylinux1_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cu118

Then I accessed the completions interface and everything was normal, but chat/completions reported an error

curl http://localhost:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "/models/Qwen1.5-32B-Chat-GPTQ-Int4",
        "prompt": "你是谁",
        "max_tokens": 512,
        "temperature": 0
    }'
ERROR
INFO:     172.17.0.1:47950 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
    self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
    raise AttributeError(attribute)
AttributeError: __pydantic_core_schema__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 303, in _eval_type_backport
    return _eval_type(value, globalns, localns, type_params)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 332, in _eval_type
    return typing._eval_type(  # type: ignore
  File "/usr/lib/python3.8/typing.py", line 270, in _eval_type
    return t._evaluate(globalns, localns)
  File "/usr/lib/python3.8/typing.py", line 518, in _evaluate
    eval(self.__forward_code__, globalns, localns),
  File "<string>", line 1, in <module>
TypeError: 'pydantic_core._pydantic_core.PydanticUndefinedType' object is not subscriptable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 291, in app
    solved_result = await solve_dependencies(
  File "/usr/local/lib/python3.8/dist-packages/fastapi/dependencies/utils.py", line 639, in solve_dependencies
    ) = await request_body_to_args(  # body_params checked above
  File "/usr/local/lib/python3.8/dist-packages/fastapi/dependencies/utils.py", line 813, in request_body_to_args
    fields_to_extract = get_cached_model_fields(first_field.type_)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
    return get_model_fields(model)
  File "/usr/local/lib/python3.8/dist-packages/fastapi/_compat.py", line 284, in get_model_fields
    return [
  File "/usr/local/lib/python3.8/dist-packages/fastapi/_compat.py", line 285, in <listcomp>
    ModelField(field_info=field_info, name=name)
  File "<string>", line 6, in __init__
  File "/usr/local/lib/python3.8/dist-packages/fastapi/_compat.py", line 110, in __post_init__
    self._type_adapter: TypeAdapter[Any] = TypeAdapter(
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 257, in __init__
    self._init_core_attrs(rebuild_mocks=False)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 135, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
    self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/type_adapter.py", line 95, in _get_schema
    schema = gen.generate_schema(type_)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
    return self._annotated_schema(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
    schema = self._apply_annotations(source_type, annotations)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
    schema = get_inner_schema(source_type)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
    schema = metadata_get_schema(source, get_inner_schema)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 2185, in <lambda>
    lambda source, handler: handler(source)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
    schema = self._generate_schema_inner(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
    return self._match_generic_type(obj, origin)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1062, in _match_generic_type
    return self._list_schema(self._get_first_arg_or_any(obj))
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 431, in _list_schema
    return core_schema.list_schema(self.generate_schema(items_type))
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
    return self._match_generic_type(obj, origin)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
    return self._union_schema(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
    choices.append(self.generate_schema(arg))
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 999, in match_type
    return self._typed_dict_schema(obj, None)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_generate_schema.py", line 1487, in _typed_dict_schema
    for field_name, annotation in get_cls_type_hints_lenient(typed_dict_cls, self._types_namespace).items():
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 245, in get_cls_type_hints_lenient
    hints[name] = eval_type_lenient(value, globalns, localns)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 257, in eval_type_lenient
    return eval_type_backport(value, globalns, localns)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 279, in eval_type_backport
    return _eval_type_backport(value, globalns, localns, type_params)
  File "/usr/local/lib/python3.8/dist-packages/pydantic/_internal/_typing_extra.py", line 311, in _eval_type_backport
    raise TypeError(
TypeError: Unable to evaluate type annotation 'Required[Union[str, Iterable[ChatCompletionContentPartTextParam]]]'. If you are making use of the new typing syntax (unions using `|` since Python 3.10 or builtins subscripting since Python 3.9), you should either replace the use of new syntax with the existing `typing` constructs or install the `eval_type_backport` package.

Before submitting a new issue...

  • [X] Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

youqugit avatar Sep 13 '24 07:09 youqugit

You need to upgrade Pydantic to 2.9 and FastAPI to 0.114. See #8212

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

You need to upgrade Pydantic to 2.9 and FastAPI to 0.114. See #8212

Pydantic and FastAPI is meeting the requirements

root@135f6c4efbf9:/app# pip show Pydantic
Name: pydantic
Version: 2.9.1
Summary: Data validation using Python type hints
Home-page: https://github.com/pydantic/pydantic
Author: 
Author-email: Samuel Colvin <[email protected]>, Eric Jolibois <[email protected]>, Hasan Ramezani <[email protected]>, Adrian Garcia Badaracco <[email protected]>, Terrence Dorsey <[email protected]>, David Montague <[email protected]>, Serge Matveenko <[email protected]>, Marcelo Trylesinski <[email protected]>, Sydney Runkle <[email protected]>, David Hewitt <[email protected]>, Alex Hall <[email protected]>
License: 
Location: /usr/local/lib/python3.8/dist-packages
Requires: annotated-types, pydantic-core, typing-extensions
Required-by: confection, fastapi, lm-format-enforcer, mistral_common, openai, outlines, spacy, thinc, vllm
root@135f6c4efbf9:/app# pip show FastAPI
Name: fastapi
Version: 0.114.1
Summary: FastAPI framework, high performance, easy to learn, fast to code, ready for production
Home-page: https://github.com/fastapi/fastapi
Author: 
Author-email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <[email protected]>
License: 
Location: /usr/local/lib/python3.8/dist-packages
Requires: pydantic, starlette, typing-extensions
Required-by: vllm

youqugit avatar Sep 13 '24 08:09 youqugit

Which version of typing_extensions do you have installed?

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

typing_extensions Version: 4.12.2

youqugit avatar Sep 13 '24 08:09 youqugit

What is your version of openai-python?

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

openai-python is not installed

youqugit avatar Sep 13 '24 08:09 youqugit

Sorry, I mean openai.

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

root@135f6c4efbf9:/app# pip show openai
Name: openai
Version: 1.45.0
Summary: The official Python library for the openai API
Home-page: https://github.com/openai/openai-python
Author: 
Author-email: OpenAI <[email protected]>
License: 
Location: /usr/local/lib/python3.8/dist-packages
Requires: anyio, distro, httpx, jiter, pydantic, sniffio, tqdm, typing-extensions
Required-by: vllm

youqugit avatar Sep 13 '24 08:09 youqugit

Hmm, I installed these versions locally and failed to repro the issue. The only thing left to check is the Python version, since I'm on Python 3.10 rather than Python 3.8.

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

ye,My python vresion is Python 3.8.10

youqugit avatar Sep 13 '24 08:09 youqugit

Actually wait - can you also upgrade the version of pydantic_core?

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

vllm-0.6.1+cu118-cp38-cp38-manylinux1_x86_64.whl May have some problems? pydantic_core is 2.23.3 I try to update it

youqugit avatar Sep 13 '24 08:09 youqugit

root@135f6c4efbf9:/app# pip install -U pydantic_core -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: pydantic_core in /usr/local/lib/python3.8/dist-packages (2.23.3)
Requirement already satisfied: typing-extensions!=4.7.0,>=4.6.0 in /usr/local/lib/python3.8/dist-packages (from pydantic_core) (4.12.2)

youqugit avatar Sep 13 '24 08:09 youqugit

Hmm, since Python 3.8 is going to reach EOL soon, it may be better to just upgrade your Python version. Otherwise, temporarily downgrading fastapi < 0.113 may also work.

DarkLight1337 avatar Sep 13 '24 08:09 DarkLight1337

Thank you I will try it

youqugit avatar Sep 13 '24 08:09 youqugit

Hmm, since Python 3.8 is going to reach EOL soon, it may be better to just upgrade your Python version. Otherwise, temporarily downgrading fastapi < 0.113 may also work.

This is the right way

youqugit avatar Sep 13 '24 09:09 youqugit

@DarkLight1337 fixing the version will solve this for now, but proposed a permanent fix here

pachewise avatar Sep 13 '24 12:09 pachewise

@DarkLight1337 fixing the version will solve this for now, but proposed a permanent fix here

Thanks for looking into this in such detail!

DarkLight1337 avatar Sep 13 '24 12:09 DarkLight1337

For no reason, this just started happening to me. Total madness, wtf.

fullstackwebdev avatar Oct 08 '24 07:10 fullstackwebdev

For no reason, this just started happening to me. Total madness, wtf.

You may have to re-install vLLM to ensure that the dependency versions are correct.

DarkLight1337 avatar Oct 08 '24 08:10 DarkLight1337

facing the same issue with python 3.9 and !pip install fastapi==0.112 doesn't seem to help

MoritzLaurer avatar Oct 08 '24 10:10 MoritzLaurer

facing the same issue with python 3.9 and !pip install fastapi==0.112 doesn't seem to help

What is your Pydantic and OpenAI version?

DarkLight1337 avatar Oct 08 '24 10:10 DarkLight1337

Restarted the environment again it it worked with this now:

!pip install -q torch torchvision
!pip install -q pillow
!pip install -q einops 
!pip install -q timm
!pip install -q vllm
!pip install -q openai
!pip install fastapi==0.112.2
pip freeze
aiohappyeyeballs==2.4.3
aiohttp==3.10.9
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.6.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
async-timeout==4.0.3
attrs==24.2.0
babel==2.16.0
beautifulsoup4==4.12.3
bleach==6.1.0
brotlipy==0.7.0
certifi==2021.5.30
cffi @ file:///tmp/build/80754af9/cffi_1625814692085/work
chardet @ file:///tmp/build/80754af9/chardet_1607706775000/work
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
comm==0.2.2
conda==4.10.3
conda-package-handling @ file:///tmp/build/80754af9/conda-package-handling_1618262147379/work
cryptography @ file:///tmp/build/80754af9/cryptography_1616767007030/work
datasets==3.0.1
debugpy==1.8.5
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.8
diskcache==5.6.3
distro==1.9.0
einops==0.8.0
exceptiongroup==1.2.2
executing==2.1.0
fastapi==0.112.2
fastjsonschema==2.20.0
filelock==3.16.1
fqdn==1.5.1
frozenlist==1.4.1
fsspec==2024.6.1
gguf==0.10.0
h11==0.14.0
httpcore==1.0.5
httptools==0.6.1
httpx==0.27.2
huggingface-hub==0.25.1
idna @ file:///home/linux1/recipes/ci/idna_1610986105248/work
importlib-metadata==8.5.0
interegular==0.3.3
ipykernel==6.29.5
ipython==8.18.1
ipywidgets==8.1.5
isoduration==20.11.0
jedi==0.19.1
jinja2==3.1.4
jiter==0.6.1
json5==0.9.25
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-client==8.6.3
jupyter-core==5.7.2
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter-server==2.14.2
jupyter-server-terminals==0.5.3
jupyterlab==4.2.5
jupyterlab-pygments==0.3.0
jupyterlab-server==2.27.3
jupyterlab-widgets==3.0.13
lark==1.2.2
llvmlite==0.43.0
lm-format-enforcer==0.10.6
MarkupSafe==2.1.5
matplotlib-inline==0.1.7
mistral-common==1.4.4
mistune==3.0.2
mpmath==1.3.0
msgpack==1.1.0
msgspec==0.18.6
multidict==6.1.0
multiprocess==0.70.16
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
networkx==3.2.1
notebook-shim==0.2.4
numba==0.60.0
numpy==1.26.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-ml-py==12.560.30
nvidia-nccl-cu12==2.20.5
nvidia-nvjitlink-cu12==12.6.77
nvidia-nvtx-cu12==12.1.105
openai==1.51.1
outlines==0.0.46
overrides==7.7.0
packaging==24.1
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
partial-json-parser==0.2.1.1.post4
pexpect==4.9.0
pillow==10.4.0
platformdirs==4.3.6
prometheus-client==0.21.0
prometheus-fastapi-instrumentator==7.0.0
prompt-toolkit==3.0.47
propcache==0.2.0
protobuf==5.28.2
psutil==6.0.0
ptyprocess==0.7.0
pure-eval==0.2.3
py-cpuinfo==9.0.0
pyairports==2.1.1
pyarrow==17.0.0
pycosat==0.6.3
pycountry==24.6.1
pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work
pydantic==2.9.2
pydantic-core==2.23.4
pygments==2.18.0
pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1608057966937/work
PySocks @ file:///tmp/build/80754af9/pysocks_1605305812635/work
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-json-logger==2.0.7
pytz==2024.2
PyYAML==6.0.2
pyzmq==26.2.0
ray==2.37.0
referencing==0.35.1
regex==2024.9.11
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.20.0
ruamel-yaml-conda @ file:///tmp/build/80754af9/ruamel_yaml_1616016711199/work
safetensors==0.4.5
Send2Trash==1.8.3
sentencepiece==0.2.0
six @ file:///tmp/build/80754af9/six_1623709665295/work
sniffio==1.3.1
soupsieve==2.6
stack-data==0.6.3
starlette==0.38.6
sympy==1.13.3
terminado==0.18.1
tiktoken==0.7.0
timm==1.0.9
tinycss2==1.3.0
tokenizers==0.20.0
tomli==2.0.1
torch==2.4.0
torchvision==0.19.0
tornado==6.2
tqdm==4.66.5
traitlets==5.14.3
transformers==4.45.2
triton==3.0.0
types-python-dateutil==2.9.0.20240906
typing-extensions==4.12.2
tzdata==2024.2
uri-template==1.3.0
urllib3 @ file:///tmp/build/80754af9/urllib3_1625084269274/work
uvicorn==0.31.0
uvloop==0.20.0
vllm==0.6.2
watchfiles==0.24.0
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
websockets==13.1
widgetsnbextension==4.0.13
xformers==0.0.27.post2
xxhash==3.5.0
yarl==1.14.0
zipp==3.20.2

MoritzLaurer avatar Oct 08 '24 11:10 MoritzLaurer