chayanbhansali commited on
Commit
ea219e7
·
verified ·
1 Parent(s): 440bb16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -79,7 +79,7 @@ class RAGChatbot:
79
  tokens = self.tokenizer(full_prompt, return_tensors="pt", padding=True, truncation=True).to(self.model.device)
80
  inputs = tokens.input_ids.to(self.model.device)
81
  attention_mask = tokens.attention_mask
82
- outputs = self.model.generate(inputs, max_new_tokens=128,attention_mask=attention_mask,pad_token_id=self.tokenizer.eos_token_id,repetition_penalty=1.0))
83
  response = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
84
 
85
  return response.split("Answer:")[-1].strip()
 
79
  tokens = self.tokenizer(full_prompt, return_tensors="pt", padding=True, truncation=True).to(self.model.device)
80
  inputs = tokens.input_ids.to(self.model.device)
81
  attention_mask = tokens.attention_mask
82
+ outputs = self.model.generate(inputs, max_new_tokens=128,attention_mask=attention_mask,pad_token_id=self.tokenizer.eos_token_id,repetition_penalty=1.0)
83
  response = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
84
 
85
  return response.split("Answer:")[-1].strip()