Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload document error #5

Open
charles331 opened this issue Jun 2, 2024 · 2 comments
Open

Upload document error #5

charles331 opened this issue Jun 2, 2024 · 2 comments

Comments

@charles331
Copy link

Hello,

I try to upload a document on windows 11 and got an error:
image

details of error:

app | Traceback (most recent call last):
app | File "/usr/local/lib/python3.11/shutil.py", line 853, in move
app | os.rename(src, real_dst)
app | FileNotFoundError: [Errno 2] No such file or directory: '/tmp/gradio/ea1957b6a8b742a53875fec0a987901ef9e06d26/Data_Exchange_Technical_Guide.pdf' -> '/code/data/data/Data_Exchange_Technical_Guide.pdf'
app |
app | During handling of the above exception, another exception occurred:
app |
app | Traceback (most recent call last):
app | File "/usr/local/lib/python3.11/site-packages/gradio/queueing.py", line 521, in process_events
app | response = await route_utils.call_process_api(
app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/gradio/route_utils.py", line 276, in call_process_api
app | output = await app.get_blocks().process_api(
app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/gradio/blocks.py", line 1945, in process_api
app | result = await self.call_function(
app | ^^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/gradio/blocks.py", line 1513, in call_function
app | prediction = await anyio.to_thread.run_sync(
app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
app | return await get_async_backend().run_sync_in_worker_thread(
app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
app | return await future
app | ^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
app | result = context.run(func, *args)
app | ^^^^^^^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/gradio/utils.py", line 831, in wrapper
app | response = f(*args, **kwargs)
app | ^^^^^^^^^^^^^^^^^^
app | File "/usr/local/lib/python3.11/site-packages/gradio/utils.py", line 831, in wrapper
app | response = f(*args, **kwargs)
app | ^^^^^^^^^^^^^^^^^^
app | File "/code/rag_chatbot/ui/ui.py", line 209, in _processing_document
app | shutil.move(src=file_path, dst=dest)
app | File "/usr/local/lib/python3.11/shutil.py", line 873, in move
app | copy_function(src, real_dst)
app | File "/usr/local/lib/python3.11/shutil.py", line 448, in copy2
app | copyfile(src, dst, follow_symlinks=follow_symlinks)
app | File "/usr/local/lib/python3.11/shutil.py", line 258, in copyfile
app | with open(dst, 'wb') as fdst:
app | ^^^^^^^^^^^^^^^
app | FileNotFoundError: [Errno 2] No such file or directory: '/code/data/data/Data_Exchange_Technical_Guide.pdf'

@gitszabolcs
Copy link

Same here, I had to manually create the data folder in /code/data, after that it worked. I guess this could be an easy fix

@fantastic-413
Copy link

I encountered the same problem, I just changed a few lines and the problem was solved. Add the following code at the beginning of the _processing_document method in the rag_chatbot\ui\ui.py file:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants