小编Chr*_*n01的帖子

PydanticUserError:如果您将 `@root_validator` 与 pre=False (默认)一起使用,则必须指定 `skip_on_failure=True`

我想在 google colab 中执行此代码,但出现以下错误:

from llama_index.prompts.prompts import SimpleInputPrompt

# Create a system prompt 
system_prompt = """[INST] <>
more string here.<>
"""

query_wrapper_prompt = SimpleInputPrompt("{query_str} [/INST]")
Run Code Online (Sandbox Code Playgroud)

错误:

/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_config.py:269: UserWarning: Valid config keys have changed in V2:
* 'allow_population_by_field_name' has been renamed to 'populate_by_name'
  warnings.warn(message, UserWarning)
---------------------------------------------------------------------------
PydanticUserError                         Traceback (most recent call last)
<ipython-input-36-c45796b371fe> in <cell line: 3>()
      1 # Import the prompt wrapper...
      2 # but for llama index
----> 3 from llama_index.prompts.prompts import SimpleInputPrompt
      4 # Create a system prompt …
Run Code Online (Sandbox Code Playgroud)

python prompt pydantic llama-index

15
推荐指数
1
解决办法
2万
查看次数

标签 统计

llama-index ×1

prompt ×1

pydantic ×1

python ×1