_cloud_models.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:pydatalab 作者: googledatalab 项目源码 文件源码
def __init__(self, model_name, project_id=None):
    """
    Args:
      model_name: the name of the model. It can be a model full name
          ("projects/[project_id]/models/[model_name]") or just [model_name].
      project_id: project_id of the models. If not provided and model_name is not a full name
          (not including project_id), default project_id will be used.
    """
    if project_id is None:
      self._project_id = datalab.Context.default().project_id
    self._credentials = datalab.Context.default().credentials
    self._api = discovery.build('ml', 'v1', credentials=self._credentials)
    if not model_name.startswith('projects/'):
      model_name = ('projects/%s/models/%s' % (self._project_id, model_name))
    self._full_model_name = model_name
    self._model_name = self._full_model_name.split('/')[-1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号