code: def read_vectors(
      vectors_loc: Path,
      truncate_vectors: int,
      *,
      mode: str = VectorsMode.default,
  ):
      f = ensure_shape(vectors_loc)
      header_parts = next(f).split()
      shape = tuple(int(size) for size in header_parts[:2])
      floret_settings = {}
      if mode == VectorsMode.floret:
          if len(header_parts) != 8:
              raise ValueError(
                  "Invalid header for floret vectors. "
                  "Expected: bucket dim minn maxn hash_count hash_seed BOW EOW"
              )
          floret_settings = {
              "mode": "floret",
              "minn": int(header_parts[2]),
              "maxn": int(header_parts[3]),
              "hash_count": int(header_parts[4]),
              "hash_seed": int(header_parts[5]),
              "bow": header_parts[6],
              "eow": header_parts[7],
          }
          if truncate_vectors >= 1:
              raise ValueError(Errors.E860)
      else:
          assert len(header_parts) == 2
          if truncate_vectors >= 1:
              shape = (truncate_vectors, shape[1])
      vectors_data = numpy.zeros(shape=shape, dtype="f")
      vectors_keys = []
      for i, line in enumerate(tqdm.tqdm(f, disable=None)):
          line = line.rstrip()
          pieces = line.rsplit(" ", vectors_data.shape[1])
          word = pieces.pop(0)
          if len(pieces) != vectors_data.shape[1]:
              raise ValueError(
                  Errors.E094.format(line_num=i, loc=vectors_loc)
              )
          vectors_data[i] = numpy.asarray(pieces, dtype="f")
          vectors_keys.append(word)
          if i == truncate_vectors - 1:
              break
      return vectors_data, vectors_keys, floret_settings
  
imports: import gzip
  import tarfile
  import warnings
  import zipfile
  from itertools import islice
  from pathlib import Path
  from typing import IO, TYPE_CHECKING, Any, Dict, Optional, Union
  import numpy
  import srsly
  import tqdm
  from thinc.api import Config, ConfigValidationError, fix_random_seed, set_gpu_allocator
  from ..errors import Errors, Warnings
  from ..lookups import Lookups
  from ..schemas import ConfigSchemaTraining
  from ..util import DEFAULT_OOV_PROB, OOV_RANK, ensure_path, get_sourced_components, load_model, load_model_from_config, logger, registry, resolve_dot_names
  from ..vectors import Mode
  from ..vectors import Vectors
  from .pretrain import get_tok2vec_ref
label_desc: Use image node_id 6 for calling a global function with example usage: read_vectors(vectors_loc, truncate_vectors) and returns: vectors_data,  vectors_keys,  floret_settings