code: def upload_model(model_dir, organization, token):
      """Upload the tiny models"""
  
      arch_name = model_dir.split(os.path.sep)[-1]
      repo_name = f"tiny-random-{arch_name}"
      repo_id = f"{organization}/{repo_name}"
  
      repo_exist = False
      error = None
      try:
          create_repo(
              repo_id=repo_id,
              exist_ok=False,
              repo_type="model",
              token=token,
          )
      except Exception as e:
          error = e
          if "You already created" in str(e):
              error = None
              logger.warning(
                  "Remote repository exists and will be cloned."
              )
              repo_exist = True
              try:
                  create_repo(
                      repo_id=repo_id,
                      exist_ok=True,
                      repo_type="model",
                      token=token,
                  )
              except Exception as e:
                  error = e
      if error is not None:
          raise error
  
      with tempfile.TemporaryDirectory() as tmpdir:
          repo = Repository(
              local_dir=tmpdir, clone_from=repo_id, token=token
          )
          repo.git_pull()
          shutil.copytree(model_dir, tmpdir, dirs_exist_ok=True)
  
          if repo_exist:
              # Open a PR on the existing Hub repo.
              hub_pr_url = upload_folder(
                  folder_path=model_dir,
                  repo_id=repo_id,
                  repo_type="model",
                  commit_message=f"Update tiny models for {arch_name}",
                  commit_description=f"Upload tiny models for {arch_name}",
                  create_pr=True,
                  token=token,
              )
              logger.warning(f"PR open in {hub_pr_url}.")
              # TODO: We need this information?
          else:
              # Push to Hub repo directly
              repo.git_add(auto_lfs_track=True)
              repo.git_commit(f"Upload tiny models for {arch_name}")
              repo.git_push(
                  blocking=True
              )  # this prints a progress bar with the upload
              logger.warning(
                  f"Tiny models {arch_name} pushed to {repo_id}."
              )
  
imports: import argparse
  import collections.abc
  import copy
  import inspect
  import json
  import multiprocessing
  import os
  import shutil
  import tempfile
  import traceback
  from pathlib import Path
  from check_config_docstrings import get_checkpoint_from_config_class
  from datasets import load_dataset
  from get_test_info import get_model_to_tester_mapping, get_tester_classes_for_model
  from huggingface_hub import Repository, create_repo, hf_api, upload_folder
  from transformers import CONFIG_MAPPING, FEATURE_EXTRACTOR_MAPPING, IMAGE_PROCESSOR_MAPPING, PROCESSOR_MAPPING, TOKENIZER_MAPPING, AutoTokenizer, LayoutLMv3TokenizerFast, PreTrainedTokenizer, PreTrainedTokenizerFast, logging
  from transformers.feature_extraction_utils import FeatureExtractionMixin
  from transformers.file_utils import is_tf_available, is_torch_available
  from transformers.image_processing_utils import BaseImageProcessor
  from transformers.models.auto.configuration_auto import AutoConfig, model_type_to_module_name
  from transformers.models.fsmt import configuration_fsmt
  from transformers.processing_utils import ProcessorMixin, transformers_module
  from transformers.tokenization_utils_base import PreTrainedTokenizerBase
label_desc: Use image node_id 12 for calling a global function with example usage: upload_model(model_dir, organization, token) without return types