deddoggo commited on
Commit
e05f92c
·
1 Parent(s): 734d387

fix multimodal error

Browse files
Files changed (1) hide show
  1. rag_pipeline.py +5 -4
rag_pipeline.py CHANGED
@@ -138,10 +138,11 @@ def generate_response(query: str, components: dict) -> str:
138
  # SỬA LỖI: Dùng apply_chat_template để tokenize trực tiếp
139
  # Nó sẽ tự động định dạng và chuyển thành tensor, tương thích với mô hình Vision
140
  inputs = tokenizer.apply_chat_template(
141
- messages,
142
- return_tensors="pt",
143
- add_generation_prompt=True,
144
- ).to(llm_model.device)
 
145
 
146
  # --- Bước 4: Tạo câu trả lời từ LLM ---
147
  print("--- Bắt đầu tạo câu trả lời từ LLM ---")
 
138
  # SỬA LỖI: Dùng apply_chat_template để tokenize trực tiếp
139
  # Nó sẽ tự động định dạng và chuyển thành tensor, tương thích với mô hình Vision
140
  inputs = tokenizer.apply_chat_template(
141
+ messages,
142
+ tokenize=True,
143
+ add_generation_prompt=True,
144
+ return_tensors="pt"
145
+ ).to(llm_model.device)
146
 
147
  # --- Bước 4: Tạo câu trả lời từ LLM ---
148
  print("--- Bắt đầu tạo câu trả lời từ LLM ---")