zylon-ai / private-gpt

Interact with your documents using the power of GPT, 100% privately, no data leaks
https://docs.privategpt.dev
Apache License 2.0
53.04k stars 7.12k forks source link

Error while trying to ingest PowerPoint files #1722

Open zerodev-exe opened 4 months ago

zerodev-exe commented 4 months ago

I'm on endeavourOS btw

This happens when I try to ingest some PowerPoint files.

Error code :


  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/llama_index/readers/file/slides/base.py", line 27, in __init__
    import torch  # noqa
    ^^^^^^^^^^^^
ModuleNotFoundError: No module named 'torch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/gradio/queueing.py", line 495, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/gradio/route_utils.py", line 235, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/gradio/blocks.py", line 1627, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/gradio/blocks.py", line 1173, in call_function
    prediction = await anyio.to_thread.run_sync(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/gradio/utils.py", line 690, in wrapper
    response = f(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^
  File "/home/zero/Developer/privateGPT/private_gpt/ui/ui.py", line 252, in _upload_file
    self._ingest_service.bulk_ingest([(str(path.name), path) for path in paths])
  File "/home/zero/Developer/privateGPT/private_gpt/server/ingest/ingest_service.py", line 84, in bulk_ingest
    documents = self.ingest_component.bulk_ingest(files)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/Developer/privateGPT/private_gpt/components/ingest/ingest_component.py", line 130, in bulk_ingest
    documents = IngestionHelper.transform_file_into_documents(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/Developer/privateGPT/private_gpt/components/ingest/ingest_helper.py", line 74, in transform_file_into_documents
    documents = IngestionHelper._load_file_to_documents(file_name, file_data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zero/Developer/privateGPT/private_gpt/components/ingest/ingest_helper.py", line 95, in _load_file_to_documents
    return reader_cls().load_data(file_data)
           ^^^^^^^^^^^^
  File "/home/zero/.cache/pypoetry/virtualenvs/private-gpt-dxfqfqnq-py3.11/lib/python3.11/site-packages/llama_index/readers/file/slides/base.py", line 36, in __init__
    raise ImportError(
ImportError: Please install extra dependencies that are required for the PptxReader: `pip install torch transformers python-pptx Pillow`
09:29:56.187 [INFO    ]            uvicorn.access - 127.0.0.1:50118 - "GET /queue/data?session_hash=g8oleucobj9 HTTP/1.1" 200```

I think this error is due to the fact that I didn't download the dependencies for the poetry cli tool, but I have no clue how to use it. 
Can someone pls give me some commands that will fix this.
akhvedelidze commented 4 months ago

Hi

Did you try to install the library for ppt transformation

pip install torch transformers python-pptx Pillow

zerodev-exe commented 4 months ago

Hi

Did you try to install the library for ppt transformation

pip install torch transformers python-pptx Pillow

Yes I did it was the first thing I did but it still gives me the exact same error

matbgn commented 1 month ago

I got same error and can double that running

pip install torch transformers python-pptx Pillow

Did not solve the problem.

d-tdhillon commented 1 month ago

@zerodev-exe any success with this ? I am also getting the same error in-spite of running pip install torch transformers python-pptx Pillow

zerodev-exe commented 1 month ago

@zerodev-exe any success with this ? I am also getting the same error in-spite of running pip install torch transformers python-pptx Pillow @d-tdhillon sorry I haven't. There are alternatives now, though.

alekseevpg commented 14 hours ago

@zerodev-exe any success with this ? I am also getting the same error in-spite of running pip install torch transformers python-pptx Pillow @d-tdhillon sorry I haven't. There are alternatives now, though.

What are the alternatives?