code: def adjust_length_to_model(length, max_sequence_length):
      if length < 0 and max_sequence_length > 0:
          length = max_sequence_length
      elif 0 < max_sequence_length < length:
          length = max_sequence_length  # No generation bigger than model size
      elif length < 0:
          length = MAX_LENGTH  # avoid infinite loop
      return length
  
file_path: H2O/h2o_flexgen/benchmark/xsum/run_xsum_h2o.py
imports: import argparse
  import numpy
  import torch
  import json
  import time
  from tqdm import tqdm
  import copy
  from flexgen.flex_opt import Policy, OptLM, ExecutionEnv, CompressionConfig
  from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
label_desc: Use image node_id 2 for calling a global function with example usage: adjust_length_to_model(length, max_sequence_length) and returns: length