class_docstr: Log OpenAI fine-tunes to [Weights & Biases](https://wandb.me/openai-docs).
class_docstr_tok: ["Log","OpenAI","fine-tunes","to","[","Weights","&","Biases","]","(","https",":","\/\/wandb.me\/openai-docs",")","."]
code: def _unpack_hyperparameters(cls, hyperparameters: Hyperparameters):
      # `Hyperparameters` object is not unpacking properly using `vars` or `__dict__`,
      # vars(hyperparameters) return {n_epochs: n} only.
      hyperparams = {}
      try:
          hyperparams["n_epochs"] = hyperparameters.n_epochs
          hyperparams["batch_size"] = hyperparameters.batch_size
          hyperparams[
              "learning_rate_multiplier"
          ] = hyperparameters.learning_rate_multiplier
      except Exception:
          # If unpacking fails, return the object to be logged as config
          return None
  
      return hyperparams
  
imports: import datetime
  import io
  import json
  import re
  import time
  from typing import Any, Dict, Optional, Tuple
  from pkg_resources import parse_version
  import wandb
  from wandb import util
  from wandb.data_types import Table
  from wandb.sdk.lib import telemetry
  from wandb.sdk.wandb_run import Run
  from openai import OpenAI
  from openai.types.fine_tuning import FineTuningJob
  from openai.types.fine_tuning.fine_tuning_job import Hyperparameters
label_desc: Use image node_id 8 for calling the WandbLogger obj's underlying member method code with example usage: obj._unpack_hyperparameters(cls, hyperparameters) and returns: hyperparams, None