Skip to content

Commit

Permalink
fix_multimodal_eval_pipeline (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceceliachenen authored Nov 25, 2024
1 parent 9f3784c commit de22a2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pai_rag/evaluation/generator/multimodal_qca_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ async def agenerate_predicted_qca_dataset(self, rag_qca_dataset):
async def agenerate_predicted_multimodal_qca_sample(
self, qca_sample, **response_kwargs: Any
):
image_url_list = qca_sample.reference_image_url_list
image_url_list = qca_sample.reference_image_url_list or []
image_documents = load_image_urls(image_url_list)
image_context_str = "\n\n".join(image_url_list)
reference_contexts = qca_sample.reference_contexts
reference_contexts = qca_sample.reference_contexts or []
text_context_str = "\n\n".join(reference_contexts)
query_str = qca_sample.query
context_str = f"{text_context_str}\n\n图片链接列表: \n\n{image_context_str}\n\n"
Expand All @@ -107,7 +107,7 @@ async def agenerate_predicted_multimodal_qca_sample(
return qca_sample

async def agenerate_predicted_qca_sample(self, qca_sample, **response_kwargs: Any):
reference_contexts = qca_sample.reference_contexts
reference_contexts = qca_sample.reference_contexts or []
text_context_str = "\n\n".join(reference_contexts)
query_str = qca_sample.query
text_qa_template = self._text_qa_template.partial_format(query_str=query_str)
Expand Down

0 comments on commit de22a2d

Please sign in to comment.