master
/ coding_here.ipynb

coding_here.ipynb @24a882a

25761e1
 
 
 
5637e2b
25761e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5637e2b
25761e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def handle(conf):\n",
    "    \"\"\"\n",
    "    该方法是部署之后,其他人调用你的服务时候的处理方法。\n",
    "    请按规范填写参数结构,这样我们就能替你自动生成配置文件,方便其他人的调用。\n",
    "    范例:\n",
    "    params['key'] = value # value_type: str # description: some description\n",
    "    value_type 可以选择img, video, audio, str, int, float, [int], [str], [float]\n",
    "    参数请放到params字典中我们会自动解析该变量。\n",
    "    \"\"\"\n",
    "\n",
    "#     param1 = conf['param1']  # value_type: str # description: some description\n",
    "    start_words = conf['start_words']    #诗歌开始\n",
    "    prefix_words = conf['prefix_words']  #诗歌语境\n",
    "    max_gen_len = conf['max_gen_len']    #诗歌最大长度\n",
    "    # add your code\n",
    "    if __name__ == '__main__':\n",
    "        result = main.gen(start_words,prefix_words,max_gen_len)\n",
    "        result = ''.json(result)\n",
    "    return {'result': result}\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}