rmusser01 / tldw

tl/dw (Too Long, Didn't Watch): Your Personal Research Multi-Tool - a naive attempt at 'A Young Lady's Illustrated Primer'
https://tldwproject.com
Apache License 2.0
396 stars 12 forks source link

Can't upload EPUB files #339

Closed jveronese closed 1 month ago

jveronese commented 1 month ago

Are You on the Latest version? You did a git pull and are running the latest version/build? Yes

Please describe the bug I go to upload a .epub file, but receive an error that the filetype is invalid and I need to upload an .epub or .zip

Is the bug reproducable reliably? Yes, happens every time

Steps to to reproduce the issue

  1. Go to Ingest
  2. Choose upload epub
  3. attempt to upload an epub file

What was the expected behavior? That epub would upload and process

Desktop (please complete the following information): TLDW - Running on Ubuntu 24.04 install with Ollama My Desktop - OS- MacOS Sequoia 15.0.1 Browser - Chrome 129.0.6668.90

rmusser01 commented 1 month ago

Thank you for the heads up, I will look at this later today.

rmusser01 commented 1 month ago

The issue should be resolved now. Please perform a pull to update your local copy and retry, it should work @jveronese

jveronese commented 1 month ago

Did a fresh pull (from both the update script and a git clone of the repo) and I am still getting the error. Here is my terminal output from the server, maybe it helps.

Traceback (most recent call last):
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/queueing.py", line 622, in process_events
    response = await route_utils.call_process_api(
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/route_utils.py", line 323, in call_process_api
    output = await app.get_blocks().process_api(
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/blocks.py", line 2012, in process_api
    inputs = await self.preprocess_data(
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1711, in preprocess_data
    processed_input.append(block.preprocess(inputs_cached))
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/components/file.py", line 163, in preprocess
    return self._process_single_file(payload)
  File "/home/aiadmin/tldw/venv/lib/python3.10/site-packages/gradio/components/file.py", line 132, in _process_single_file
    raise Error(
gradio.exceptions.Error: "Invalid file type. Please upload a file that is one of these formats: ['.epub', '.zip']"
rmusser01 commented 1 month ago

@jveronese Hmm, can you do two things please,

  1. Is the epub file your uploading end in .epub? If not, can you please rename it and then retry,
  2. Can you please upload the file in /tldw/App_Function_Libraries/Books/Book_Ingestion_Lib.py? That error message doesn't show in my current source code, and I don't know how else to check/confirm if its Gradio that's throwing the error.

I've tried with multiple epubs with my current implementation but I haven't been able to replicate the error.