Unable to get chunks of uploaded pdf file

ValueError: File path <tempfile._TemporaryFileWrapper object at 0x000002C9CABCE480> is not a valid file or url

Traceback:

File "E:\Code\VRN's RAG\myenv\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^File "E:\Code\VRN's RAG\myenv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)File "E:\Code\VRN's RAG\app.py", line 41, in <module>
    all_splits = process_document(uploaded_file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "E:\Code\VRN's RAG\app.py", line 19, in process_document
    loader = PyMuPDFLoader(temp_file)
             ^^^^^^^^^^^^^^^^^^^^^^^^File "E:\Code\VRN's RAG\myenv\Lib\site-packages\langchain_community\document_loaders\pdf.py", line 429, in __init__
    super().__init__(file_path, headers=headers)File "E:\Code\VRN's RAG\myenv\Lib\site-packages\langchain_community\document_loaders\pdf.py", line 117, in __init__
    raise ValueError("File path %s is not a valid file or url" % self.file_path)