Update app.py
Browse files
app.py
CHANGED
@@ -27,12 +27,13 @@ def top_k_top_p_filtering( logits, top_k=0, top_p=0.0, filter_value=-float('Inf'
|
|
27 |
|
28 |
def generate(title, context, max_len):
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
title_ids = tokenizer.encode(title, add_special_tokens=False)
|
33 |
-
context_ids = tokenizer.encode(context, add_special_tokens=False)
|
34 |
-
input_ids = title_ids + [sep_id] + context_ids
|
35 |
-
print(input_ids)
|
36 |
cur_len = len(input_ids)
|
37 |
input_len = cur_len
|
38 |
last_token_id = input_ids[-1]
|
|
|
27 |
|
28 |
def generate(title, context, max_len):
|
29 |
|
30 |
+
input_ids.extend( tokenizer.encode(title + "-" + context, add_special_tokens=False) )
|
31 |
+
|
32 |
+
# title_ids = tokenizer.encode(title, add_special_tokens=False)
|
33 |
+
# context_ids = tokenizer.encode(context, add_special_tokens=False)
|
34 |
+
# input_ids = title_ids + [sep_id] + context_ids
|
35 |
+
# print(input_ids)
|
36 |
|
|
|
|
|
|
|
|
|
37 |
cur_len = len(input_ids)
|
38 |
input_len = cur_len
|
39 |
last_token_id = input_ids[-1]
|