Spaces:
Sleeping
Sleeping
chayanbhansali
commited on
Update app.py
Browse files
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()
|