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 b16fc50 commit 708b2e2
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ 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 @@ -388,12 +385,7 @@ def main():
text_chunks = [item["sentence_chunk"] for item in pages_and_chunks]

st.session_state.embeddings =st.session_state.embedding_model.encode(text_chunks, batch_size=64, convert_to_tensor=True)
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 btn:


if query:
with st.spinner('Generating response...'):
rep=ask(query,st.session_state.embedding_model,st.session_state.embeddings,st.session_state.pages_and_chunks)
Expand Down

0 comments on commit 708b2e2

Please sign in to comment.