diff --git a/handler.py b/handler.py index 13e63b2..f78ee8e 100644 --- a/handler.py +++ b/handler.py @@ -8,20 +8,8 @@ 参数请放到params字典中,我们会自动解析该变量。 """ -# param1 = conf['param1'] # value_type: str # description: some description - # start_words = conf['start_words'] #诗歌开始 - # prefix_words = conf['prefix_words'] #诗歌语境 - # max_gen_len = conf['max_gen_len'] #诗歌最大长度 - # # add your code - # if __name__ == '__main__': - # cnf = {start_words,prefix_words,max_gen_len} - # result = main.gen(**cnf) - # result = ''.json(result) - # return {'result': result} - if __name__ == '__main__': import main - # conf={'start_words':"雨",'prefix_words':"天晴", 'max_gen_len':100} start_words = conf['start_words'] #诗歌开始 prefix_words = conf['prefix_words'] #诗歌语境 max_gen_len = conf['max_gen_len'] #诗歌最大长度 @@ -31,7 +19,5 @@ "start_words" : start_words # 诗歌开始 } result = main.gen(**cof) - result = ''.join(result) - # print(result) return {'ret1':result} diff --git a/main.py b/main.py index 8389137..75d10df 100644 --- a/main.py +++ b/main.py @@ -223,6 +223,7 @@ gen_poetry = gen_acrostic if opt.acrostic else generate result = gen_poetry(model, start_words, ix2word, word2ix, prefix_words) + result = ''.join(result) return result