opendatalab/LabelLLM

本地debug,报pydantic的KeyError: 'UUID'

fenglvming opened this issue · 3 comments

启动方式,本地python app/main.py

File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 197, in walk
return f(schema, self._walk)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 441, in collect_refs
return recurse(s, collect_refs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 200, in _walk
schema = self._schema_type_to_method[schema['type']](schema.copy(), f)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'UUID'

可以提供更多有效信息吗,例如完整的启动步骤

UUID是百度的标记算法, 你看一下怎么弄

根据 beanie 这个库的 issues,将models中各个类的id, Indexed(UUID, unique=True) 改成 Annotated[UUID, Indexed(unique=True)]可以解决这个问题。