Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def generate_response(passage: str, question: str) -> str:
|
|
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 |
|
27 |
|
28 |
return response
|
|
|
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].split("<|assistant|>")[-1].strip()
|
26 |
|
27 |
|
28 |
return response
|