Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def main():
|
|
49 |
inputs = tokenizer(query, text, return_tensors='tf')
|
50 |
#outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
51 |
outputs = qa_model(input_ids=inputs['input_ids'])
|
52 |
-
loss =
|
53 |
answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
|
54 |
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])
|
55 |
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|
|
|
49 |
inputs = tokenizer(query, text, return_tensors='tf')
|
50 |
#outputs = qa_model(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
51 |
outputs = qa_model(input_ids=inputs['input_ids'])
|
52 |
+
loss = outputs.loss
|
53 |
answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
|
54 |
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])
|
55 |
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|