Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ else:
|
|
16 |
@spaces.GPU
|
17 |
def generate_response(passage: str, question: str) -> str:
|
18 |
# Prepare the input text by combining the passage and question
|
19 |
-
|
20 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
21 |
|
22 |
# Generate text, focusing only on the new tokens added by the model
|
|
|
16 |
@spaces.GPU
|
17 |
def generate_response(passage: str, question: str) -> str:
|
18 |
# Prepare the input text by combining the passage and question
|
19 |
+
messages = [{"role": "user", "content": f"Passage: {passage}\nQuestion: {question}"}]
|
20 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
21 |
|
22 |
# Generate text, focusing only on the new tokens added by the model
|