Update app.py
Browse files
app.py
CHANGED
@@ -23,8 +23,8 @@ def generate_response(passage: str, question: str) -> str:
|
|
23 |
outputs = model.generate(inputs.input_ids, max_new_tokens=150)
|
24 |
|
25 |
# Decode only the generated part, skipping the prompt input
|
26 |
-
generated_tokens = outputs[0][inputs.input_ids.shape[-1]:] # Ignore input tokens in the output
|
27 |
-
response = tokenizer.
|
28 |
|
29 |
return response
|
30 |
|
|
|
23 |
outputs = model.generate(inputs.input_ids, max_new_tokens=150)
|
24 |
|
25 |
# Decode only the generated part, skipping the prompt input
|
26 |
+
# generated_tokens = outputs[0][inputs.input_ids.shape[-1]:] # Ignore input tokens in the output
|
27 |
+
response = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
28 |
|
29 |
return response
|
30 |
|