class_docstr: Abstract base class for uploading trained model artifacts to different repositories.
  
  This class defines the interface for uploading trained model artifacts to various repositories such as Huggingface
  Hub, without specifying the concrete implementation for each repository. Subclasses of this base class must
  implement the 'login' and 'upload' methods.
docstr: Validate parameters before uploading trained model artifacts.
  
  This method checks if the input parameters meet the necessary requirements before uploading
  trained model artifacts to the target repository.
  
  Args:
      repo_id (str): The ID of the target repository. Each provider will verify their specific rules.
      model_path (str): The path to the directory containing the trained model artifacts. It should contain
          the model's weights, usually saved under 'model/model_weights'.
      repo_type (str, optional): The type of the repository. Not used in the base class, but subclasses
          may use it for specific repository implementations. Defaults to None.
      private (bool, optional): Whether the repository should be private or not. Not used in the base class,
          but subclasses may use it for specific repository implementations. Defaults to False.
      commit_message (str, optional): A message to attach to the commit when uploading to version control
          systems. Not used in the base class, but subclasses may use it for specific repository
          implementations. Defaults to None.
      commit_description (str, optional): A description of the commit when uploading to version control
          systems. Not used in the base class, but subclasses may use it for specific repository
          implementations. Defaults to None.
  
  Raises:
      FileNotFoundError: If the model_path does not exist.
      Exception: If the trained model artifacts are not found at the expected location within model_path, or
          if the artifacts are not in the required format (i.e., 'pytorch_model.bin'; or 'adapter_model.bin' or
          'adapter_model.safetensors').
docstr_tok: ["Validate","parameters","before","uploading","trained","model","artifacts",".","This","method","checks","if","the","input","parameters","meet","the","necessary","requirements","before","uploading","trained","model","artifacts","to","the","target","repository",".","Args",":","repo_id","(","str",")",":","The","ID","of","the","target","repository",".","Each","provider","will","verify","their","specific","rules",".","model_path","(","str",")",":","The","path","to","the","directory","containing","the","trained","model","artifacts",".","It","should","contain","the","model","'s","weights",",","usually","saved","under","'model\/model_weights","'",".","repo_type","(","str",",","optional",")",":","The","type","of","the","repository",".","Not","used","in","the","base","class",",","but","subclasses","may","use","it","for","specific","repository","implementations",".","Defaults","to","None",".","private","(","bool",",","optional",")",":","Whether","the","repository","should","be","private","or","not",".","Not","used","in","the","base","class",",","but","subclasses","may","use","it","for","specific","repository","implementations",".","Defaults","to","False",".","commit_message","(","str",",","optional",")",":","A","message","to","attach","to","the","commit","when","uploading","to","version","control","systems",".","Not","used","in","the","base","class",",","but","subclasses","may","use","it","for","specific","repository","implementations",".","Defaults","to","None",".","commit_description","(","str",",","optional",")",":","A","description","of","the","commit","when","uploading","to","version","control","systems",".","Not","used","in","the","base","class",",","but","subclasses","may","use","it","for","specific","repository","implementations",".","Defaults","to","None",".","Raises",":","FileNotFoundError",":","If","the","model_path","does","not","exist",".","Exception",":","If","the","trained","model","artifacts","are","not","found","at","the","expected","location","within","model_path",",","or","if","the","artifacts","are","not","in","the","required","format","(","i.e.",",","'pytorch_model.bin","'",";","or","'adapter_model.bin","'","or","'adapter_model.safetensors","'",")","."]
code: def _validate_upload_parameters(
      repo_id: str,
      model_path: str,
      repo_type: str | None = None,
      private: bool | None = False,
      commit_message: str | None = None,
      commit_description: str | None = None,
  ):
      """Validate parameters before uploading trained model artifacts.
  
      This method checks if the input parameters meet the necessary requirements before uploading
      trained model artifacts to the target repository.
  
      Args:
          repo_id (str): The ID of the target repository. Each provider will verify their specific rules.
          model_path (str): The path to the directory containing the trained model artifacts. It should contain
              the model's weights, usually saved under 'model/model_weights'.
          repo_type (str, optional): The type of the repository. Not used in the base class, but subclasses
              may use it for specific repository implementations. Defaults to None.
          private (bool, optional): Whether the repository should be private or not. Not used in the base class,
              but subclasses may use it for specific repository implementations. Defaults to False.
          commit_message (str, optional): A message to attach to the commit when uploading to version control
              systems. Not used in the base class, but subclasses may use it for specific repository
              implementations. Defaults to None.
          commit_description (str, optional): A description of the commit when uploading to version control
              systems. Not used in the base class, but subclasses may use it for specific repository
              implementations. Defaults to None.
  
      Raises:
          FileNotFoundError: If the model_path does not exist.
          Exception: If the trained model artifacts are not found at the expected location within model_path, or
              if the artifacts are not in the required format (i.e., 'pytorch_model.bin'; or 'adapter_model.bin' or
              'adapter_model.safetensors').
      """
      # Make sure the model's save path is actually a valid path
      if not os.path.exists(model_path):
          raise FileNotFoundError(
              f"The path '{model_path}' does not exist."
          )
  
      # Make sure the model is actually trained
      trained_model_artifacts_path = os.path.join(
          model_path, "model", "model_weights"
      )
      if not os.path.exists(trained_model_artifacts_path):
          raise Exception(
              f"Model artifacts not found at {trained_model_artifacts_path}. "
              f"It is possible that model at '{model_path}' hasn't been trained yet, or something went"
              "wrong during training where the model's weights were not saved."
          )
  
imports: from __future__ import annotations
  import logging
  import os
  from abc import ABC, abstractmethod
  from huggingface_hub import HfApi, login
label_desc: Use image node_id 3 for calling the BaseModelUpload obj's underlying member method code with example usage: obj._validate_upload_parameters(repo_id, model_path, repo_type, private, commit_message, commit_description) without return types