Spaces:
Running
Running
MVPilgrim
commited on
Commit
·
e1c8322
1
Parent(s):
56efbf9
debug
Browse files
app.py
CHANGED
@@ -367,30 +367,30 @@ try:
|
|
367 |
logger.info("#### getRagData() entered.")
|
368 |
###############################################################################
|
369 |
# Initial the the sentence transformer and encode the query prompt.
|
370 |
-
logger.
|
371 |
model = SentenceTransformer('/app/multi-qa-MiniLM-L6-cos-v1')
|
372 |
|
373 |
vector = model.encode(promptText)
|
374 |
vectorList = []
|
375 |
|
376 |
-
logger.
|
377 |
for vec in vector:
|
378 |
vectorList.append(vec)
|
379 |
-
logger.
|
380 |
|
381 |
# Fetch chunks and print chunks.
|
382 |
-
logger.
|
383 |
wpChunksCollection = st.session_state.wpChunksCollection
|
384 |
semChunks = wpChunksCollection.query.near_vector(
|
385 |
near_vector=vectorList,
|
386 |
distance=0.7,
|
387 |
limit=3
|
388 |
)
|
389 |
-
logger.
|
390 |
|
391 |
# Print chunks, corresponding document and document title.
|
392 |
ragData = ""
|
393 |
-
logger.
|
394 |
wpCollection = st.session_state.wpCollection
|
395 |
for chunk in enumerate(semChunks.objects):
|
396 |
logger.info(f"#### chunk: {chunk}")
|
|
|
367 |
logger.info("#### getRagData() entered.")
|
368 |
###############################################################################
|
369 |
# Initial the the sentence transformer and encode the query prompt.
|
370 |
+
logger.info(f"#### Encode text query prompt to create vectors. {promptText}")
|
371 |
model = SentenceTransformer('/app/multi-qa-MiniLM-L6-cos-v1')
|
372 |
|
373 |
vector = model.encode(promptText)
|
374 |
vectorList = []
|
375 |
|
376 |
+
logger.info("#### Print vectors.")
|
377 |
for vec in vector:
|
378 |
vectorList.append(vec)
|
379 |
+
logger.info(f"vectorList: {vectorList[2]}")
|
380 |
|
381 |
# Fetch chunks and print chunks.
|
382 |
+
logger.info("#### Retrieve semchunks from db using vectors from prompt.")
|
383 |
wpChunksCollection = st.session_state.wpChunksCollection
|
384 |
semChunks = wpChunksCollection.query.near_vector(
|
385 |
near_vector=vectorList,
|
386 |
distance=0.7,
|
387 |
limit=3
|
388 |
)
|
389 |
+
logger.info(f"### semChunks[0]: {semChunks}")
|
390 |
|
391 |
# Print chunks, corresponding document and document title.
|
392 |
ragData = ""
|
393 |
+
logger.info("#### Print individual retrieved chunks.")
|
394 |
wpCollection = st.session_state.wpCollection
|
395 |
for chunk in enumerate(semChunks.objects):
|
396 |
logger.info(f"#### chunk: {chunk}")
|