Update main.py
Browse files
main.py
CHANGED
@@ -142,12 +142,12 @@ def Search(input, categorie):
|
|
142 |
elif categorie == "videosTC":
|
143 |
search = vectorstore.similarity_search(input,k=50, filter={"title": {"$eq": "videos-confinement-timeline"}})
|
144 |
for i in range(0,len(search)):
|
145 |
-
if count <=
|
146 |
count = count + 1
|
147 |
timeSeq = search[i].metadata["time"]
|
148 |
timeSeqRound = round(timeSeq)
|
149 |
time = timedelta(seconds=timeSeqRound)
|
150 |
-
sources_text = sources_text + '<div class="gridvid"><a target="_blank" title="' + search[i].metadata['titre'] + ' : ...' + search[i].page_content + '" href="' + search[i].metadata['video'] + '#start=' + str(timeSeq) + '"><img src="' + search[i].metadata['image'] + '" width="100%" alt="' + search[i].metadata['titre'] + ' : ...' + search[i].page_content + '"/><p>๐ ' + str(time) + ' : ...' + search[i].page_content + '</p></a></div>'
|
151 |
verbatim_text = verbatim_text + "<p style='font-size:0.8rem'>" + str(count) + ". " + search[i].metadata['titre'] + "</p><p style='font-size:0.8rem'>๐ "+ str(time) + " : " + search[i].page_content + "</p>"
|
152 |
|
153 |
results = [sources_text, verbatim_text, sources_offres]
|
|
|
142 |
elif categorie == "videosTC":
|
143 |
search = vectorstore.similarity_search(input,k=50, filter={"title": {"$eq": "videos-confinement-timeline"}})
|
144 |
for i in range(0,len(search)):
|
145 |
+
if count <= 17:
|
146 |
count = count + 1
|
147 |
timeSeq = search[i].metadata["time"]
|
148 |
timeSeqRound = round(timeSeq)
|
149 |
time = timedelta(seconds=timeSeqRound)
|
150 |
+
sources_text = sources_text + '<div class="gridvid"><a target="_blank" title="' + search[i].metadata['titre'] + ' : ...' + search[i].page_content + '" href="' + search[i].metadata['video'] + '#start=' + str(timeSeq) + '"><img src="' + search[i].metadata['image'] + '" width="100%" alt="' + search[i].metadata['titre'] + ' : ...' + search[i].page_content + '"/><p>๐ ' + str(time) + ' : ...' + search[i].page_content + ' : ' + search[i].metadata['titre'] + '</p></a></div>'
|
151 |
verbatim_text = verbatim_text + "<p style='font-size:0.8rem'>" + str(count) + ". " + search[i].metadata['titre'] + "</p><p style='font-size:0.8rem'>๐ "+ str(time) + " : " + search[i].page_content + "</p>"
|
152 |
|
153 |
results = [sources_text, verbatim_text, sources_offres]
|