From 80dc6af5207f1ca072aec4a4cf157dc71862d4c3 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Sun, 23 Jun 2024 06:55:05 +0900 Subject: [PATCH] Update streamlit-pdf-viewer and enable text rendering --- requirements.txt | 2 +- streamlit_app.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9b4f9bb..26211e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,6 +24,6 @@ typing-inspect==0.9.0 typing_extensions==4.11.0 pydantic==2.6.4 sentence_transformers==2.6.1 -streamlit-pdf-viewer +streamlit-pdf-viewer==0.0.14 umap-learn plotly \ No newline at end of file diff --git a/streamlit_app.py b/streamlit_app.py index f2b7029..cc78582 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -274,9 +274,6 @@ def play_old_messages(): disabled=st.session_state['doc_id'] is not None or st.session_state['uploaded'] ) - st.markdown( - ":warning: [Usage disclaimer](https://github.com/lfoppiano/document-qa?tab=readme-ov-file#disclaimer-on-data-security-and-privacy-%EF%B8%8F) :warning: ") - if (model in OPEN_MODELS) and model not in st.session_state['api_keys']: if 'HUGGINGFACEHUB_API_TOKEN' not in os.environ: api_key = st.text_input('Huggingface API Key', type="password") @@ -326,7 +323,7 @@ def play_old_messages(): st.subheader("Upload a scientific article in PDF, ask questions, get insights.") st.markdown( - ":warning: Do not upload sensitive data. We **temporarily** store text from the uploaded PDF documents solely for the purpose of processing your request, and we **do not assume responsibility** for any subsequent use or handling of the data submitted to third parties LLMs.") + ":warning: [Usage disclaimer](https://github.com/lfoppiano/document-qa?tab=readme-ov-file#disclaimer-on-data-security-and-privacy-%EF%B8%8F) :warning: ") uploaded_file = st.file_uploader( "Upload an article", @@ -549,8 +546,6 @@ def generate_color_gradient(num_elements): if st.session_state['binary']: pdf_viewer( input=st.session_state['binary'], - width=600, - height=800, annotation_outline_size=1, annotations=st.session_state['annotations'], rendering=st.session_state['pdf_rendering'],