yilunzhao commited on
Commit
f1b2fc3
·
verified ·
1 Parent(s): 5bc259c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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
- message = [{"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
 
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