Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -153,13 +153,13 @@ def chatbot(pdf_file, user_question):
|
|
153 |
doc = retrieve_document(user_question)
|
154 |
|
155 |
if doc:
|
156 |
-
print(f"found doc{doc}")
|
157 |
# Split into smaller chunks
|
158 |
chunks = split_text(doc)
|
159 |
|
160 |
# Use only the first chunk (to optimize token usage)
|
161 |
prompt = f"Based on this document, answer the question:\n\nDocument:\n{chunks[0]}\n\nQuestion: {user_question}"
|
162 |
-
print(f"prompt
|
163 |
else:
|
164 |
prompt=user_question
|
165 |
|
|
|
153 |
doc = retrieve_document(user_question)
|
154 |
|
155 |
if doc:
|
156 |
+
print(f"found doc:\n{doc}\n")
|
157 |
# Split into smaller chunks
|
158 |
chunks = split_text(doc)
|
159 |
|
160 |
# Use only the first chunk (to optimize token usage)
|
161 |
prompt = f"Based on this document, answer the question:\n\nDocument:\n{chunks[0]}\n\nQuestion: {user_question}"
|
162 |
+
print(f"prompt:\n{prompt}")
|
163 |
else:
|
164 |
prompt=user_question
|
165 |
|