Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramyrahmeni committed Jun 17, 2024
1 parent 4e28404 commit 379b30f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def translate_role_for_streamlit(user_role):
st.session_state.embedding_model = SentenceTransformer(model_name_or_path="all-mpnet-base-v2", device="cpu")
if 'pages_and_chunks' not in st.session_state:
st.session_state.pages_and_chunks = None
st.write(f"Embeddings: {st.session_state.embeddings}")
st.write(f"Embedding Model: {st.session_state.embedding_model}")
st.write(f"Pages and Chunks: {st.session_state.pages_and_chunks}")
# Initialize chat session in Streamlit if not already present
def text_formatter(text: str) -> str:
"""Performs minor formatting on text."""
Expand Down Expand Up @@ -387,6 +390,9 @@ def main():
st.session_state.embeddings =st.session_state.embedding_model.encode(text_chunks, batch_size=64, convert_to_tensor=True)

if btn:
st.write(f"Embeddings: {st.session_state.embeddings}")
st.write(f"Embedding Model: {st.session_state.embedding_model}")
st.write(f"Pages and Chunks: {st.session_state.pages_and_chunks}")

if query:
with st.spinner('Generating response...'):
Expand Down

0 comments on commit 379b30f

Please sign in to comment.