class_docstr: 用来初始化 `Driver` 的基类，所有定制的 `driver` 都需要继承此类；
  **fastNLP** 提供的 driver 实例都会同时被 :class:`~fastNLP.core.controllers.Trainer` 和 :class:`~fastNLP.core.controllers.Evaluator` 调用。
  
  :param model: 训练或者评测的模型，需要注意该模型可能为用户已经使用类似 :class:`torch.nn.DataParallel` 或者
      :class:`torch.nn.parallel.DistributedDataParallel` 包裹过的模型。
class_docstr_tok: ["\u7528\u6765\u521d\u59cb\u5316","`","Driver","`","\u7684\u57fa\u7c7b\uff0c\u6240\u6709\u5b9a\u5236\u7684","`","driver","`","\u90fd\u9700\u8981\u7ee7\u627f\u6b64\u7c7b\uff1b","*","*","fastNLP","*","*","\u63d0\u4f9b\u7684","driver","\u5b9e\u4f8b\u90fd\u4f1a\u540c\u65f6\u88ab",":","class",":","`","~fastNLP.core.controllers.Trainer","`","\u548c",":","class",":","`","~fastNLP.core.controllers.Evaluator","`","\u8c03\u7528\u3002",":","param","model",":","\u8bad\u7ec3\u6216\u8005\u8bc4\u6d4b\u7684\u6a21\u578b\uff0c\u9700\u8981\u6ce8\u610f\u8be5\u6a21\u578b\u53ef\u80fd\u4e3a\u7528\u6237\u5df2\u7ecf\u4f7f\u7528\u7c7b\u4f3c",":","class",":","`","torch.nn.DataParallel","`","\u6216\u8005",":","class",":","`","torch.nn.parallel.DistributedDataParallel","`","\u5305\u88f9\u8fc7\u7684\u6a21\u578b\u3002"]
docstr: 保证用户拿到的模型一定是最原始的模型；
  注意因为我们把保存模型的主要逻辑和代码移到了 `Driver` 中，因此在 :meth:`save_model` 函数中，一定要先调用此函数来保证我们保存的模型一定是
  最为原始的模型；
  需要注意用户本身传入的模型就是经过类似 :class:`torch.nn.DataParallel` 或者 :class:`torch.nn.parallel.DistributedDataParallel` 包裹的模型，
  因此在该函数内需要先判断模型的类别。
  
  :return: 最原始的模型，例如没有被 :class:`DistributedDataParallel` 包裹的模型。
docstr_tok: ["\u4fdd\u8bc1\u7528\u6237\u62ff\u5230\u7684\u6a21\u578b\u4e00\u5b9a\u662f\u6700\u539f\u59cb\u7684\u6a21\u578b\uff1b","\u6ce8\u610f\u56e0\u4e3a\u6211\u4eec\u628a\u4fdd\u5b58\u6a21\u578b\u7684\u4e3b\u8981\u903b\u8f91\u548c\u4ee3\u7801\u79fb\u5230\u4e86","`","Driver","`","\u4e2d\uff0c\u56e0\u6b64\u5728",":","meth",":","`","save_model","`","\u51fd\u6570\u4e2d\uff0c\u4e00\u5b9a\u8981\u5148\u8c03\u7528\u6b64\u51fd\u6570\u6765\u4fdd\u8bc1\u6211\u4eec\u4fdd\u5b58\u7684\u6a21\u578b\u4e00\u5b9a\u662f","\u6700\u4e3a\u539f\u59cb\u7684\u6a21\u578b\uff1b","\u9700\u8981\u6ce8\u610f\u7528\u6237\u672c\u8eab\u4f20\u5165\u7684\u6a21\u578b\u5c31\u662f\u7ecf\u8fc7\u7c7b\u4f3c",":","class",":","`","torch.nn.DataParallel","`","\u6216\u8005",":","class",":","`","torch.nn.parallel.DistributedDataParallel","`","\u5305\u88f9\u7684\u6a21\u578b\uff0c","\u56e0\u6b64\u5728\u8be5\u51fd\u6570\u5185\u9700\u8981\u5148\u5224\u65ad\u6a21\u578b\u7684\u7c7b\u522b\u3002",":","return",":","\u6700\u539f\u59cb\u7684\u6a21\u578b\uff0c\u4f8b\u5982\u6ca1\u6709\u88ab",":","class",":","`","DistributedDataParallel","`","\u5305\u88f9\u7684\u6a21\u578b\u3002"]
code: def unwrap_model(self):
      r"""
      保证用户拿到的模型一定是最原始的模型；
      注意因为我们把保存模型的主要逻辑和代码移到了 `Driver` 中，因此在 :meth:`save_model` 函数中，一定要先调用此函数来保证我们保存的模型一定是
      最为原始的模型；
      需要注意用户本身传入的模型就是经过类似 :class:`torch.nn.DataParallel` 或者 :class:`torch.nn.parallel.DistributedDataParallel` 包裹的模型，
      因此在该函数内需要先判断模型的类别。
  
      :return: 最原始的模型，例如没有被 :class:`DistributedDataParallel` 包裹的模型。
      """
  
imports: import os
  import signal
  import sys
  from typing import Sequence, List, Optional, Callable, Dict, Union, Tuple
  from abc import ABC, abstractmethod
  from datetime import datetime
  from pathlib import Path
  from io import BytesIO
  import json
  from fastNLP.core.utils import nullcontext
label_desc: Use image node_id 31 for calling the Driver obj's underlying member method code with example usage: obj.unwrap_model() without return types