DataRaptor commited on
Commit
cd4a034
1 Parent(s): 49da5be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -77,7 +77,8 @@ with st.sidebar:
77
  ctx_checker_tmp = 0.008
78
  lm_tmp = st.slider('Language Model Sensitivity', min_value=0.001, max_value=1.0, value=0.1, step=0.001)
79
  verbose = st.checkbox('Show Detailed Response', value=False)
80
-
 
81
 
82
 
83
 
@@ -128,12 +129,14 @@ def main():
128
  return
129
 
130
  response = resp['data']['responses'][0]['content']
 
131
  context = resp['data']['logs']['content']['retrival_model']['matched_doc']
132
 
133
  if verbose:
134
  clen = len(context)
 
135
  context = '\n\n===============================\n\n'.join(context)
136
- response = f'###### Config: Context Checker Value: {ctx_checker_tmp}, LM Value: {lm_tmp}\n\n##### Matched Context: {clen}\n{context}\n\n##### Response:\n{response}'
137
 
138
 
139
  # Display assistant response in chat message container
 
77
  ctx_checker_tmp = 0.008
78
  lm_tmp = st.slider('Language Model Sensitivity', min_value=0.001, max_value=1.0, value=0.1, step=0.001)
79
  verbose = st.checkbox('Show Detailed Response', value=False)
80
+ if verbose == True:
81
+ retv_cnt = st.slider('Display N retrived Doc', min_value=0, max_value=32, value=0, step=1)
82
 
83
 
84
 
 
129
  return
130
 
131
  response = resp['data']['responses'][0]['content']
132
+ retrived = resp['data']['logs']['content']['retrival_model']['retrived_docs'][:retv_cnt]
133
  context = resp['data']['logs']['content']['retrival_model']['matched_doc']
134
 
135
  if verbose:
136
  clen = len(context)
137
+ retrived = '\n\n===============================\n\n'.join(retrived)
138
  context = '\n\n===============================\n\n'.join(context)
139
+ response = f'###### Config: Context Checker Value: {ctx_checker_tmp}, LM Value: {lm_tmp}\n\n##### Retrived Context: {retrived}\n\n##### Matched Context: {clen}\n{context}\n\n##### Response:\n{response}'
140
 
141
 
142
  # Display assistant response in chat message container