cb58f6c
SV08 4 years ago
2 changed file(s) with 1 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
77 参数请放到params字典中,我们会自动解析该变量。
88 """
99
10 # param1 = conf['param1'] # value_type: str # description: some description
11 # start_words = conf['start_words'] #诗歌开始
12 # prefix_words = conf['prefix_words'] #诗歌语境
13 # max_gen_len = conf['max_gen_len'] #诗歌最大长度
14 # # add your code
15 # if __name__ == '__main__':
16 # cnf = {start_words,prefix_words,max_gen_len}
17 # result = main.gen(**cnf)
18 # result = ''.json(result)
19 # return {'result': result}
20
2110 if __name__ == '__main__':
2211 import main
23 # conf={'start_words':"雨",'prefix_words':"天晴", 'max_gen_len':100}
2412 start_words = conf['start_words'] #诗歌开始
2513 prefix_words = conf['prefix_words'] #诗歌语境
2614 max_gen_len = conf['max_gen_len'] #诗歌最大长度
3018 "start_words" : start_words # 诗歌开始
3119 }
3220 result = main.gen(**cof)
33 result = ''.join(result)
34 # print(result)
3521 return {'ret1':result}
3622
222222
223223 gen_poetry = gen_acrostic if opt.acrostic else generate
224224 result = gen_poetry(model, start_words, ix2word, word2ix, prefix_words)
225 result = ''.join(result)
225226 return result
226227
227228