Skip to content

Commit

Permalink
add more embedding functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Jun 24, 2024
1 parent c2c0fd1 commit 8520312
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
DEFAULT_OPEN_EMBEDDING_NAME = 'Default (all-MiniLM-L6-v2)'
OPEN_EMBEDDINGS = {
DEFAULT_OPEN_EMBEDDING_NAME: 'all-MiniLM-L6-v2',
'Salesforce/SFR-Embedding-Mistral': 'Salesforce/SFR-Embedding-Mistral'
'SFR-Embedding-Mistral': 'Salesforce/SFR-Embedding-Mistral',
'SFR-Embedding-2_R': 'Salesforce/SFR-Embedding-2_R',
'NV-Embed': 'nvidia/NV-Embed-v1',
'e5-mistral-7b-instruct': 'intfloat/e5-mistral-7b-instruct'
}

if 'rqa' not in st.session_state:
Expand Down Expand Up @@ -358,16 +361,6 @@ def play_old_messages(container):
st.markdown("**Revision number**: [" + st.session_state[
'git_rev'] + "](https://github.com/lfoppiano/document-qa/commit/" + st.session_state['git_rev'] + ")")

st.header("Query mode (Advanced use)")
st.markdown(
"""By default, the mode is set to LLM (Language Model) which enables question/answering.
You can directly ask questions related to the document content, and the system will answer the question using content from the document.""")

st.markdown(
"""If you switch the mode to "Embedding," the system will return specific chunks from the document
that are semantically related to your query. This mode helps to test why sometimes the answers are not
satisfying or incomplete. """)

if uploaded_file and not st.session_state.loaded_embeddings:
if model not in st.session_state['api_keys']:
st.error("Before uploading a document, you must enter the API key. ")
Expand Down

0 comments on commit 8520312

Please sign in to comment.