Update utils.py
Browse files- front/utils.py +2 -0
front/utils.py
CHANGED
@@ -43,6 +43,8 @@ def process_figures(docs:list)->tuple:
|
|
43 |
gallery=[]
|
44 |
used_figures =[]
|
45 |
figures = '<div class="figures-container"><p></p> </div>'
|
|
|
|
|
46 |
docs_figures = [d for d in docs if d.metadata["chunk_type"] == "image"]
|
47 |
for i, doc in enumerate(docs_figures):
|
48 |
if doc.metadata["chunk_type"] == "image":
|
|
|
43 |
gallery=[]
|
44 |
used_figures =[]
|
45 |
figures = '<div class="figures-container"><p></p> </div>'
|
46 |
+
if docs == []:
|
47 |
+
return figures, gallery
|
48 |
docs_figures = [d for d in docs if d.metadata["chunk_type"] == "image"]
|
49 |
for i, doc in enumerate(docs_figures):
|
50 |
if doc.metadata["chunk_type"] == "image":
|