Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,7 @@ from transformers import DistilBertTokenizerFast, DistilBertForQuestionAnswering
|
|
3 |
|
4 |
model_name = "distilbert-base-cased"
|
5 |
tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
|
6 |
-
|
7 |
-
model = DistilBertForQuestionAnswering.from_pretrained(model_name, output_attentions=False, output_hidden_states=False)
|
8 |
|
9 |
def format_response(start_index, end_index, raw_answer):
|
10 |
answer_tokens = tokenizer.convert_tokens_to_string([tokenizer.convert_ids_to_tokens(i)[0] for i in range(start_index, end_index+1)])
|
|
|
3 |
|
4 |
model_name = "distilbert-base-cased"
|
5 |
tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
|
6 |
+
model = DistilBertForQuestionAnswering.from_pretrained(model_name)
|
|
|
7 |
|
8 |
def format_response(start_index, end_index, raw_answer):
|
9 |
answer_tokens = tokenizer.convert_tokens_to_string([tokenizer.convert_ids_to_tokens(i)[0] for i in range(start_index, end_index+1)])
|