You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: filter multimodal content from log samples while preserving metadata (#962)
* fix: improve spatialviz utils quality
- Fix FileExistsError -> FileNotFoundError (correct exception type)
- Replace print() with eval_logger for consistent logging
- Add type hints to all functions
- Fix missing comma bug in final_answer_patterns list
- Remove redundant image_path = image_path assignment
- Initialize op variable to prevent potential UnboundLocalError
- Break long prompt string for readability (88 char line limit)
* style: apply black formatting
* fix: filter multimodal content from log samples while preserving metadata
When using --log_samples, the previous implementation either saved all
fields (causing serialization issues with images/audio) or filtered based
on key names (missing useful metadata like image_id, image_path).
This fix introduces is_multimodal_content() that detects actual multimodal
data types (PIL.Image, numpy arrays, torch tensors, HuggingFace audio/image
dicts) while preserving all scalar metadata fields for dataset traceability.
Github-Issue:#943
prompt="You should first provide a reasoning process, then provide a single option(A, B, C or D) as the final answer. The reasoning process and the answer are enclosed within <think></think> and <answer></answer> tags, respectively, i.e., <think>reasoning process</think>, <answer>answer</answer>.\n"
46
+
prompt= (
47
+
"You should first provide a reasoning process, then provide a single "
48
+
"option(A, B, C or D) as the final answer. The reasoning process and "
49
+
"the answer are enclosed within <think></think> and <answer></answer> "
final_answer_patterns= ["<answer>", "Answer:", "Final answer", "final answer", "Final Answer", "the answer is", "The answer is", "correct answer", "Correct answer", "Correct Answer", "答案""correct path"]
80
+
eval_logger.debug("No match for think/answer tags in response")
0 commit comments