Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,15 +23,14 @@ def extract_longer_answers_from_paragraphs(paragraphs, query, tokenizer, model):
|
|
23 |
context += question
|
24 |
inputs = tokenizer(context, return_tensors="pt", add_special_tokens=False).to(device)
|
25 |
top_p = 0.9 # Adjust as needed
|
26 |
-
|
27 |
outputs = model.generate(
|
28 |
**inputs,
|
29 |
top_p=top_p,
|
30 |
-
max_length=max_len,
|
31 |
num_beams=1,
|
32 |
do_sample= True,
|
33 |
no_repeat_ngram_size=2,
|
34 |
-
max_new_tokens=
|
35 |
)
|
36 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
37 |
|
|
|
23 |
context += question
|
24 |
inputs = tokenizer(context, return_tensors="pt", add_special_tokens=False).to(device)
|
25 |
top_p = 0.9 # Adjust as needed
|
26 |
+
|
27 |
outputs = model.generate(
|
28 |
**inputs,
|
29 |
top_p=top_p,
|
|
|
30 |
num_beams=1,
|
31 |
do_sample= True,
|
32 |
no_repeat_ngram_size=2,
|
33 |
+
max_new_tokens= 1024,
|
34 |
)
|
35 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
36 |
|