chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

instance of MultiModalFeature, tuple or dict expected (type=type_error.dataclass; class_name=MultiModalFeature)

Open ehalit opened this issue 11 months ago • 2 comments

I have been using chainlit smoothly for a while and I decided to upgrade to the newest version.

After running pip install -U chainlit and installation completes, chainlit hello fails with the following error:

  File "pydantic/dataclasses.py", line 332, in pydantic.dataclasses._add_pydantic_validation_attributes.new_init
    in comparison functions.  metadata, if specified, must be a
  File "pydantic/dataclasses.py", line 447, in pydantic.dataclasses._dataclass_validate_values
    # No default factory.
pydantic.error_wrappers.ValidationError: 1 validation error for FeaturesSettings
multi_modal
  instance of MultiModalFeature, tuple or dict expected (type=type_error.dataclass; class_name=MultiModalFeature)

Current System

  • MacOS Sonoma 14.4
  • Python 3.9.6

ehalit avatar Apr 03 '24 10:04 ehalit

I had a similar error after upgrading. For me it was just a matter of updating config.toml with the new way of configuring multi_modal as described here

[features.multi_modal]
    enabled = false
    accept = ["*/*"]
    max_files = 20
    max_size_mb = 500```

martinskeem avatar Apr 03 '24 18:04 martinskeem

You have to delete the config.toml file. Running chainlit run your_file.py will generate a new one.

constantinidan avatar Apr 08 '24 13:04 constantinidan

@martinskeem answered

ModEnter avatar Sep 12 '24 08:09 ModEnter