Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ def get_question(sentence,answer,mdl,tknizer):
|
|
11 |
prompt = "context: {} answer: {}".format(sentence,answer)
|
12 |
print (prompt)
|
13 |
max_len = 256
|
14 |
-
encoding = tknizer.encode_plus(
|
15 |
|
16 |
input_ids, attention_mask = encoding["input_ids"], encoding["attention_mask"]
|
17 |
|
|
|
11 |
prompt = "context: {} answer: {}".format(sentence,answer)
|
12 |
print (prompt)
|
13 |
max_len = 256
|
14 |
+
encoding = tknizer.encode_plus(prompt,max_length=max_len, pad_to_max_length=False,truncation=True, return_tensors="pt")
|
15 |
|
16 |
input_ids, attention_mask = encoding["input_ids"], encoding["attention_mask"]
|
17 |
|