Skip to content

Commit

Permalink
fixes to message ordering (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-dunteman authored Nov 5, 2024
1 parent 8032017 commit 1fa1b6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 06_gpu_and_ml/llm-serving/chat_with_pdf_vision.py
Original file line number Diff line number Diff line change
@@ -285,7 +285,7 @@ def get_relevant_image(self, message, session, images):
def generate_response(self, message, session, image):
chatbot_message = get_chatbot_message_with_image(message, image)
query = self.qwen2_vl_processor.apply_chat_template(
[chatbot_message, *session.messages],
[*session.messages, chatbot_message],
tokenize=False,
add_generation_prompt=True,
)
@@ -299,7 +299,7 @@ def generate_response(self, message, session, image):
inputs = inputs.to("cuda:0")

generated_ids = self.qwen2_vl_model.generate(
**inputs, max_new_tokens=128
**inputs, max_new_tokens=512
)
generated_ids_trimmed = [
out_ids[len(in_ids) :]

0 comments on commit 1fa1b6e

Please sign in to comment.