Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,6 @@ def save_chat_to_dataset(user_message, bot_message):
|
|
51 |
def process_pdf_with_langchain(pdf_path):
|
52 |
"""Process a PDF file and create a FAISS retriever."""
|
53 |
try:
|
54 |
-
# Load the PDF
|
55 |
loader = PyPDFLoader(pdf_path)
|
56 |
documents = loader.load()
|
57 |
|
@@ -99,6 +98,7 @@ def generate_response(query, memory, retriever=None, use_pdf_context=False):
|
|
99 |
model="deepseek-r1-distill-llama-70b"
|
100 |
)
|
101 |
response = chat_completion.choices[0].message.content.strip()
|
|
|
102 |
memory.save_context({"input": query}, {"output": response})
|
103 |
break
|
104 |
except Exception as e:
|
|
|
51 |
def process_pdf_with_langchain(pdf_path):
|
52 |
"""Process a PDF file and create a FAISS retriever."""
|
53 |
try:
|
|
|
54 |
loader = PyPDFLoader(pdf_path)
|
55 |
documents = loader.load()
|
56 |
|
|
|
98 |
model="deepseek-r1-distill-llama-70b"
|
99 |
)
|
100 |
response = chat_completion.choices[0].message.content.strip()
|
101 |
+
|
102 |
memory.save_context({"input": query}, {"output": response})
|
103 |
break
|
104 |
except Exception as e:
|