Spaces:
Paused
Paused
Update generate_answer.py
Browse files- generate_answer.py +1 -1
generate_answer.py
CHANGED
@@ -8,7 +8,7 @@ def generate_answer(context):
|
|
8 |
prompt_template = PromptTemplate(template="Summarise the following context: {context}",
|
9 |
input_variables=["context"], output_variables=["answer"])
|
10 |
# Model loading
|
11 |
-
format_prompt = prompt_template.format(
|
12 |
encoded_input = tokenizer(format_prompt, return_tensors='pt')
|
13 |
# Run the model
|
14 |
output = model.generate(**encoded_input) # Use generate method for text generation
|
|
|
8 |
prompt_template = PromptTemplate(template="Summarise the following context: {context}",
|
9 |
input_variables=["context"], output_variables=["answer"])
|
10 |
# Model loading
|
11 |
+
format_prompt = prompt_template.format(context=context)
|
12 |
encoded_input = tokenizer(format_prompt, return_tensors='pt')
|
13 |
# Run the model
|
14 |
output = model.generate(**encoded_input) # Use generate method for text generation
|