Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -162,12 +162,12 @@ def predict_test(model, tokenizer, embedding_model, df, question, index): # sen
|
|
162 |
mostSimSegment = segments[_indices[0][0]]
|
163 |
|
164 |
Answer = model_pipeline(model, tokenizer,question,mostSimSegment)
|
165 |
-
|
166 |
# Find the start and end indices of mostSimSegment within mostSimContext
|
167 |
start_index = mostSimContext.find(Answer)
|
168 |
end_index = start_index + len(Answer)
|
169 |
|
170 |
-
print(f"answer {len(
|
171 |
print(f"mostSimContext{len(mostSimContext)}=>{mostSimContext}\nsegments{len(segments)}=>{segments}\nmostSimSegment{len(mostSimSegment)}=>{mostSimSegment}")
|
172 |
|
173 |
_time = time.time() - t
|
|
|
162 |
mostSimSegment = segments[_indices[0][0]]
|
163 |
|
164 |
Answer = model_pipeline(model, tokenizer,question,mostSimSegment)
|
165 |
+
|
166 |
# Find the start and end indices of mostSimSegment within mostSimContext
|
167 |
start_index = mostSimContext.find(Answer)
|
168 |
end_index = start_index + len(Answer)
|
169 |
|
170 |
+
print(f"answer {len(Answer)} => {Answer} || startIndex =>{start_index} || endIndex =>{end_index}")
|
171 |
print(f"mostSimContext{len(mostSimContext)}=>{mostSimContext}\nsegments{len(segments)}=>{segments}\nmostSimSegment{len(mostSimSegment)}=>{mostSimSegment}")
|
172 |
|
173 |
_time = time.time() - t
|