fschwartzer commited on
Commit
71f21fd
1 Parent(s): 2e78a3a

Update src/brain.py

Browse files
Files changed (1) hide show
  1. src/brain.py +3 -3
src/brain.py CHANGED
@@ -6,6 +6,6 @@ model = AutoModelForCausalLM.from_pretrained(model_name)
6
 
7
 
8
  def generate_answers(query):
9
- input_ids = tokenizer(query, return_tensors="pt")
10
- output = model.generate(**input_ids)
11
- return tokenizer.decode(output[0])
 
6
 
7
 
8
  def generate_answers(query):
9
+ input_ids = tokenizer(query, return_tensors="pt").input_ids
10
+ output = model.generate(input_ids, max_new_tokens=100)
11
+ return tokenizer.decode(output[0], skip_special_tokens=True)