Spaces:
Sleeping
Sleeping
DataRaptor
commited on
Commit
·
f5b2754
1
Parent(s):
11cf12b
Update app.py
Browse files
app.py
CHANGED
@@ -135,11 +135,16 @@ def main():
|
|
135 |
|
136 |
response = resp['data']['responses'][0]['content']
|
137 |
context = resp['data']['logs']['content']['retrival_model']['matched_doc']
|
|
|
138 |
|
139 |
if verbose:
|
140 |
clen = len(context)
|
141 |
retrived = resp['data']['logs']['content']['retrival_model']['retrived_doc'][:retv_cnt]
|
|
|
|
|
142 |
retrived = '\n\n===============================\n\n'.join(retrived)
|
|
|
|
|
143 |
context = '\n\n===============================\n\n'.join(context)
|
144 |
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}'
|
145 |
|
|
|
135 |
|
136 |
response = resp['data']['responses'][0]['content']
|
137 |
context = resp['data']['logs']['content']['retrival_model']['matched_doc']
|
138 |
+
context_prob = resp['data']['logs']['content']['retrival_model']['matched_prob']
|
139 |
|
140 |
if verbose:
|
141 |
clen = len(context)
|
142 |
retrived = resp['data']['logs']['content']['retrival_model']['retrived_doc'][:retv_cnt]
|
143 |
+
retrived_prob = resp['data']['logs']['content']['retrival_model']['retrived_prob'][:retv_cnt]
|
144 |
+
retrived = [str(b) + ': ' + a for a, b in zip (retrived, retrived_prob)]
|
145 |
retrived = '\n\n===============================\n\n'.join(retrived)
|
146 |
+
|
147 |
+
context = [str(b) + ': ' + a for a, b in zip (context, context_prob)]
|
148 |
context = '\n\n===============================\n\n'.join(context)
|
149 |
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}'
|
150 |
|