vakodiya commited on
Commit
47c3535
1 Parent(s): d8cf775

Update generate_answer.py

Browse files
Files changed (1) hide show
  1. 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(question=question)
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