Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,7 +74,7 @@ if pdf_path and not st.session_state.processed:
|
|
| 74 |
# Step 3: Chunking
|
| 75 |
with st.spinner("Chunking the document..."):
|
| 76 |
model_name = "nomic-ai/modernbert-embed-base"
|
| 77 |
-
embedding_model = HuggingFaceEmbeddings(model_name=model_name, model_kwargs={'device': 'cpu'})
|
| 78 |
text_splitter = SemanticChunker(embedding_model)
|
| 79 |
documents = text_splitter.split_documents(docs)
|
| 80 |
st.session_state.documents = documents
|
|
|
|
| 74 |
# Step 3: Chunking
|
| 75 |
with st.spinner("Chunking the document..."):
|
| 76 |
model_name = "nomic-ai/modernbert-embed-base"
|
| 77 |
+
embedding_model = HuggingFaceEmbeddings(model_name=model_name, model_kwargs={'device': 'cpu'}, encode_kwargs= {'normalize_embeddings': False})
|
| 78 |
text_splitter = SemanticChunker(embedding_model)
|
| 79 |
documents = text_splitter.split_documents(docs)
|
| 80 |
st.session_state.documents = documents
|