Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ def read_pdf(file):
|
|
| 40 |
logging.error(f"Failed to extract text: {e}")
|
| 41 |
return ""
|
| 42 |
|
| 43 |
-
# --- Process Answer ---
|
| 44 |
def process_answer(question, full_text):
|
| 45 |
# Save the full_text to a temporary file
|
| 46 |
with open("temp_text.txt", "w") as f:
|
|
@@ -54,7 +54,7 @@ def process_answer(question, full_text):
|
|
| 54 |
splits = text_splitter.split_documents(docs)
|
| 55 |
|
| 56 |
# Load embeddings
|
| 57 |
-
embeddings = SentenceTransformerEmbeddings(model_name="
|
| 58 |
|
| 59 |
# Create Chroma in-memory vector store
|
| 60 |
db = Chroma.from_documents(splits, embedding=embeddings)
|
|
|
|
| 40 |
logging.error(f"Failed to extract text: {e}")
|
| 41 |
return ""
|
| 42 |
|
| 43 |
+
# --- Process Answer ---dd
|
| 44 |
def process_answer(question, full_text):
|
| 45 |
# Save the full_text to a temporary file
|
| 46 |
with open("temp_text.txt", "w") as f:
|
|
|
|
| 54 |
splits = text_splitter.split_documents(docs)
|
| 55 |
|
| 56 |
# Load embeddings
|
| 57 |
+
embeddings = SentenceTransformerEmbeddings(model_name="BAAI/bge-base-en-v1.5")
|
| 58 |
|
| 59 |
# Create Chroma in-memory vector store
|
| 60 |
db = Chroma.from_documents(splits, embedding=embeddings)
|