Cinnamon / kotaemon

An open-source RAG-based tool for chatting with your documents.
https://cinnamon.github.io/kotaemon/
Apache License 2.0
17.57k stars 1.36k forks source link

[BUG] Gradio FileData Import Error in Docker Container #434

Closed Lee-Ju-Yeong closed 4 weeks ago

Lee-Ju-Yeong commented 4 weeks ago

Description

Issue Description When running the kotaemon container, the application crashes due to an import error with Gradio's FileData module. This appears to be a compatibility issue between the current implementation and the installed Gradio version.

Reproduction steps

1.Navigate to project directory containing Dockerfile
2. Run build command:
- docker build -t kotaemon -f Dockerfile .

3. ```
docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-p 7860:7860 -it --rm \
kotaemon:latest
  1. See error

Screenshots

![DESCRIPTION](LINK.png)

Logs

Traceback (most recent call last):
  File "/app/app.py", line 33, in <module>
    from ktem.main import App  # noqa
  File "/app/libs/ktem/ktem/main.py", line 1, in <module>
    import gradio as gr
  File "/usr/local/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
    import gradio._simple_templates
  File "/usr/local/lib/python3.10/site-packages/gradio/_simple_templates/__init__.py", line 1, in <module>
    from .simpledropdown import SimpleDropdown
  File "/usr/local/lib/python3.10/site-packages/gradio/_simple_templates/simpledropdown.py", line 6, in <module>
    from gradio.components.base import Component, FormComponent
  File "/usr/local/lib/python3.10/site-packages/gradio/components/__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "/usr/local/lib/python3.10/site-packages/gradio/components/annotated_image.py", line 14, in <module>
    from gradio.components.base import Component
  File "/usr/local/lib/python3.10/site-packages/gradio/components/base.py", line 20, in <module>
    from gradio.blocks import Block, BlockContext
  File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 39, in <module>
    from gradio import (
  File "/usr/local/lib/python3.10/site-packages/gradio/networking.py", line 14, in <module>
    from gradio.routes import App  # HACK: to avoid circular import # noqa: F401
  File "/usr/local/lib/python3.10/site-packages/gradio/routes.py", line 63, in <module>
    from multipart.multipart import parse_options_header
ModuleNotFoundError: No module named 'multipart.multipart'; 'multipart' is not a package

Traceback (most recent call last):
  File "/app/app.py", line 33, in <module>
    from ktem.main import App  # noqa
  File "/app/libs/ktem/ktem/main.py", line 4, in <module>
    from ktem.pages.chat import ChatPage
  File "/app/libs/ktem/ktem/pages/chat/__init__.py", line 11, in <module>
    from ktem.index.file.ui import File
  File "/app/libs/ktem/ktem/index/file/ui.py", line 12, in <module>
    from gradio.data_classes import FileData
ImportError: cannot import name 'FileData' from 'gradio.data_classes'

Browsers

Chrome

OS

Windows

Additional information

No response