Spaces:
Running
Running
Update run.py
Browse files
run.py
CHANGED
@@ -16,7 +16,7 @@ def predict(context, question):
|
|
16 |
answer_start_index = outputs.start_logits.argmax()
|
17 |
answer_end_index = outputs.end_logits.argmax()
|
18 |
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|
19 |
-
answer = tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)
|
20 |
target_start_index = torch.tensor([14])
|
21 |
target_end_index = torch.tensor([15])
|
22 |
outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
|
|
|
16 |
answer_start_index = outputs.start_logits.argmax()
|
17 |
answer_end_index = outputs.end_logits.argmax()
|
18 |
predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
|
19 |
+
answer = tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)
|
20 |
target_start_index = torch.tensor([14])
|
21 |
target_end_index = torch.tensor([15])
|
22 |
outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
|