Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def generate_response(passage: str, question: str) -> str:
|
|
20 |
|
21 |
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
22 |
inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
|
23 |
-
response = model.generate(input_ids=inputs.to(
|
24 |
|
25 |
response = tokenizer.batch_decode(response, skip_special_tokens=True)[0]
|
26 |
|
|
|
20 |
|
21 |
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
22 |
inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
|
23 |
+
response = model.generate(input_ids=inputs.to(model.device), max_new_tokens=100)
|
24 |
|
25 |
response = tokenizer.batch_decode(response, skip_special_tokens=True)[0]
|
26 |
|