Skip to content

Commit

Permalink
Update streamlit-pdf-viewer and enable text rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Jun 22, 2024
1 parent 407876d commit 80dc6af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 80dc6af

Please sign in to comment.