Spaces:
Running
on
T4
Running
on
T4
app fixes UI
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
@@ -169,7 +169,7 @@ def handle_input(state,dummy):
|
|
169 |
st.session_state.questions_.append(question_with_id)
|
170 |
if(st.session_state.input_is_colpali):
|
171 |
out_ = colpali.colpali_search_rerank(st.session_state.input_query)
|
172 |
-
|
173 |
else:
|
174 |
out_ = rag_DocumentSearcher.query_(awsauth, inputs, st.session_state['session_id'],st.session_state.input_rag_searchType)
|
175 |
st.session_state.answers_.append({
|
@@ -218,7 +218,6 @@ def render_answer(question,answer,index,res_img):
|
|
218 |
#with st.expander("Images:"):
|
219 |
|
220 |
idx = 0
|
221 |
-
print(res_img)
|
222 |
for i in range(0,len(res_img)):
|
223 |
|
224 |
if(st.session_state.input_is_colpali):
|
@@ -238,7 +237,7 @@ def render_answer(question,answer,index,res_img):
|
|
238 |
with col3_:
|
239 |
st.image(res_img[i]['file'])
|
240 |
else:
|
241 |
-
if(res_img[i]['file'].lower()!='none' and idx <
|
242 |
col3,col4,col5 = st.columns([33,33,33])
|
243 |
cols = [col3,col4]
|
244 |
img = res_img[i]['file'].split(".")[0]
|
@@ -247,11 +246,8 @@ def render_answer(question,answer,index,res_img):
|
|
247 |
with cols[idx]:
|
248 |
|
249 |
st.image(parent_dirname+"/figures/"+st.session_state.input_index+"/"+img+".jpg")
|
250 |
-
|
251 |
idx = idx+1
|
252 |
-
# if(st.session_state.show_columns == True):
|
253 |
-
# st.session_state.show_columns = False
|
254 |
-
#st.markdown("<div style='color:#e28743';padding:3px 7px 3px 7px;borderWidth: 0px;borderColor: red;borderStyle: solid;width: fit-content;height: fit-content;border-radius: 10px;'><b>Sources from the document:</b></div>", unsafe_allow_html = True)
|
255 |
if(len(answer["table"] )>0):
|
256 |
#with st.expander("Table:"):
|
257 |
df = pd.read_csv(answer["table"][0]['name'],skipinitialspace = True, on_bad_lines='skip',delimiter='`')
|
|
|
169 |
st.session_state.questions_.append(question_with_id)
|
170 |
if(st.session_state.input_is_colpali):
|
171 |
out_ = colpali.colpali_search_rerank(st.session_state.input_query)
|
172 |
+
|
173 |
else:
|
174 |
out_ = rag_DocumentSearcher.query_(awsauth, inputs, st.session_state['session_id'],st.session_state.input_rag_searchType)
|
175 |
st.session_state.answers_.append({
|
|
|
218 |
#with st.expander("Images:"):
|
219 |
|
220 |
idx = 0
|
|
|
221 |
for i in range(0,len(res_img)):
|
222 |
|
223 |
if(st.session_state.input_is_colpali):
|
|
|
237 |
with col3_:
|
238 |
st.image(res_img[i]['file'])
|
239 |
else:
|
240 |
+
if(res_img[i]['file'].lower()!='none' and idx < 1):
|
241 |
col3,col4,col5 = st.columns([33,33,33])
|
242 |
cols = [col3,col4]
|
243 |
img = res_img[i]['file'].split(".")[0]
|
|
|
246 |
with cols[idx]:
|
247 |
|
248 |
st.image(parent_dirname+"/figures/"+st.session_state.input_index+"/"+img+".jpg")
|
249 |
+
|
250 |
idx = idx+1
|
|
|
|
|
|
|
251 |
if(len(answer["table"] )>0):
|
252 |
#with st.expander("Table:"):
|
253 |
df = pd.read_csv(answer["table"][0]['name'],skipinitialspace = True, on_bad_lines='skip',delimiter='`')
|