Spaces:
Sleeping
Sleeping
Commit
·
86a4f8b
1
Parent(s):
067c7c9
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def generate_answer(question, context):
|
|
66 |
|
67 |
# Generate the answer
|
68 |
with torch.no_grad():
|
69 |
-
generated_ids = model.generate(input_ids)
|
70 |
|
71 |
# Decode and return the generated answer
|
72 |
generated_answer = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|
|
|
66 |
|
67 |
# Generate the answer
|
68 |
with torch.no_grad():
|
69 |
+
generated_ids = model.generate( input_ids=input_ids, max_new_tokens=max_target_length)
|
70 |
|
71 |
# Decode and return the generated answer
|
72 |
generated_answer = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|