master
/ Untitled.ipynb

Untitled.ipynb @da31108view markup · raw · history · blame

Notebook
In [1]:
# You can use other public modules via our Client object with module's identifier
# and parameters.
# For more detailes, please see our online document - https://momodel.github.io/docs/#
import os
import sys
# Define root path
sys.path.append('../')
# Import necessary packages
from modules import json_parser
from modules import Client
# Initialise Client object
client = Client(api_key='996c5ec910a35bc0813ba5f12f4ba667ba10af41ecd4c9dd0ff9aa5cbfc0439a',
                project_id='5cd04ee51afd94639a492b8e', user_ID='5ca1c6991afd941dd93a4052',
                project_type='app', source_file_path='Untitled.ipynb')
# Make run/train/predict command alias for further use
run = client.run
train = client.train
predict = client.predict
# Make controller alias for further use
controller = client.controller
In [ ]:
 
In [ ]:
def handle(conf): 
    """
    该方法是部署之后,其他人调用你的服务时候的处理方法。
    请按规范填写参数结构,这样我们就能替你自动生成配置文件,方便其他人的调用。
    范例:
    params['key'] = value # value_type: str # description: some description
    参数请放到params字典中,我们会自动解析该变量。
    """
    
    param1 = conf['param1']  # value_type: str # description: some description
    param2 = conf['param2']  # value_type: str # description: some description
    # add your code
    return {'ret1': 'cat', 'ret2': 'dog'}