↓ 2 callersMethod_parse_exampler""" input: a dict with keys {"question", "A", "B", "C", "D", "answer"} output: a tuple of (prompt, response)
LLaMA-Factory/src/llamafactory/eval/template.py:28
↓ 2 callersFunctionget_seqlens_in_batchr""" Gets the sequnce lengths in the current batch. e.g. ```python # input [ [1, 1, 2, 2, 2, 0], [1, 2, 2, 3, 3,
LLaMA-Factory/src/llamafactory/model/model_utils/packing.py:60
↓ 2 callersFunctionprepare_4d_attention_maskr""" Expands the attention mask with indices from (batch_size, seq_len) to (batch_size, 1, seq_len, seq_len), while handles packed sequences a
LLaMA-Factory/src/llamafactory/data/collator.py:31
↓ 1 callersFunction_encode_pairwise_example(
prompt: Sequence[Dict[str, str]],
response: Sequence[Dict[str, str]],
system: Optional[str],
LLaMA-Factory/src/llamafactory/data/processors/pairwise.py:34
↓ 1 callersFunction_encode_unsupervised_example(
prompt: Sequence[Dict[str, str]],
response: Sequence[Dict[str, str]],
system: Optional[str],
LLaMA-Factory/src/llamafactory/data/processors/unsupervised.py:34