nerozhao commited on
Commit
12e91f4
·
verified ·
1 Parent(s): 3e38ca4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -22,8 +22,10 @@ def generate_response(query):
22
  ]
23
 
24
  inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
 
25
  outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
26
- result = tokenizer.decode(outputs, skip_special_tokens=True)
 
27
  return result
28
 
29
  # Gradio interface
 
22
  ]
23
 
24
  inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
25
+ print("raw intput: " + inputs)
26
  outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
27
+ result = tokenizer.decode(outputs[0], skip_special_tokens=True)
28
+ print("raw output: " + result)
29
  return result
30
 
31
  # Gradio interface