Update services/chat_service.py
Browse files- services/chat_service.py +2 -0
services/chat_service.py
CHANGED
@@ -233,6 +233,8 @@ class ChatService:
|
|
233 |
early_stopping=False
|
234 |
)
|
235 |
|
|
|
|
|
236 |
response = self.tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
237 |
|
238 |
|
|
|
233 |
early_stopping=False
|
234 |
)
|
235 |
|
236 |
+
input_ids = tokenizer.encode(prompt, return_tensors="pt", truncation=True, max_length=4096).to("cpu")
|
237 |
+
|
238 |
response = self.tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
239 |
|
240 |
|