llama-gpt
llama-gpt copied to clipboard
model_config['protected_namespaces'] = ('settings_',)`
(base) ┌─(~/Downloads/llama-gpt-master)────────────────(iwis@iwisdeMacBook-Air:s000)─┐ └─(02:52:27)──> /Users/iwis/miniforge3/envs/llama-gpt/lib/python3.10/site-packages/pydantic/_internal/fields.py:127: UserWarning: Field "model_alias" has conflict with protected namespace "model".
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ('settings_',)
.
warnings.warn(
Same issue on mac or win.
I have little know for python
Here the GPT:
The warning message you're seeing is coming from the Python library pydantic
, which is used for data parsing and validation. It's telling you that the field model_alias
in your data model is conflicting with a protected namespace model
.
The message also gives a suggestion on how to possibly resolve this warning by setting model_config['protected_namespaces'] = ('settings_',)
. This would mean adding 'settings_'
to the protected namespaces of your model_config
.
However, this suggestion may not solve the problem if the actual conflict is with the model_alias
field. You should consider renaming the model_alias
field in your data model to avoid this conflict.
Your code might look something like this:
from pydantic import BaseModel
class MyModel(BaseModel):
model_alias: str = 'default_value' # This is conflicting with protected namespace "model"
# Change it to:
class MyModel(BaseModel):
my_model_alias: str = 'default_value' # No conflict now
But, it's hard to provide a more specific solution without seeing your actual code. If you need more help, please provide more context or more specific code.
I have the same problem. Were you able to get this resolved?
I have this same problem but only when trying to run the code
models. the chat works fine.
Saw similar here with possible solution: https://github.com/getumbrel/llama-gpt/issues/98#issuecomment-1715494487
Saw similar here with possible solution: #98 (comment)
This fixes things for me, thanks for the steer!