diff --git a/coding_here.ipynb b/coding_here.ipynb index bc37cec..dbb04e7 100644 --- a/coding_here.ipynb +++ b/coding_here.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -24,16 +24,9 @@ " if __name__ == '__main__':\n", " result = main.gen(start_words,prefix_words,max_gen_len)\n", " result = ''.json(result)\n", - " return {'你的诗歌': 'result'}\n", + " return {'result': result}\n", " " ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/handler.py b/handler.py index bbe29cd..527091a 100644 --- a/handler.py +++ b/handler.py @@ -16,5 +16,5 @@ if __name__ == '__main__': result = main.gen(start_words,prefix_words,max_gen_len) result = ''.json(result) - return {'你的诗歌': 'result'} + return {'result': result} diff --git a/main.py b/main.py index 1a39930..b6be27a 100644 --- a/main.py +++ b/main.py @@ -28,8 +28,8 @@ max_gen_len = 200 # 生成诗歌最长长度 debug_file = '/tmp/debugp' model_path = 'checkpoints/tang_199.pth' # 预训练模型路径 - prefix_words = '美女' # 不是诗歌的组成部分,用来控制生成诗歌的意境 - start_words = '雨' # 诗歌开始 + prefix_words = '笑语盈盈暗香去' # 不是诗歌的组成部分,用来控制生成诗歌的意境 + start_words = '语' # 诗歌开始 acrostic = False # 是否是藏头诗 model_prefix = 'checkpoints/tang' # 模型保存路径