Lisibonny commited on
Commit
6c53ffd
1 Parent(s): a0153d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 = tf.math.reduce_mean(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]
 
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]