code: def build_attn_bias(
      attn_impl,
      attn_bias,
      n_heads,
      seq_len,
      causal=False,
      alibi=False,
      alibi_bias_max=8,
  ):
      if attn_impl == "flash":
          return None
      elif attn_impl in ["torch", "triton"]:
          if alibi:
              (device, dtype) = (attn_bias.device, attn_bias.dtype)
              attn_bias = attn_bias.add(
                  build_alibi_bias(
                      n_heads,
                      seq_len,
                      full=not causal,
                      alibi_bias_max=alibi_bias_max,
                      device=device,
                      dtype=dtype,
                  )
              )
          return attn_bias
      else:
          raise ValueError(
              f"attn_impl={attn_impl!r} is an invalid setting."
          )
  
imports: import math
  import os
  import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers import PreTrainedModel, PreTrainedTokenizer, PreTrainedTokenizerFast
  from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
  from einops import rearrange
  from packaging import version
  from text_generation_server.utils.layers import TensorParallelEmbedding, TensorParallelColumnLinear, TensorParallelRowLinear, TensorParallelHead, get_linear
label_desc: Use image node_id 8 for calling a global function with example usage: build_attn_bias(attn_impl, attn_bias, n_heads, seq_len, causal, alibi, alibi_bias_max) and returns: None, attn_bias