Spaces:
Runtime error
Runtime error
huolongguo10
commited on
Commit
·
f4e5c25
1
Parent(s):
42029d6
Update app.py
Browse files
app.py
CHANGED
@@ -20,10 +20,10 @@ def postprocess(text):
|
|
20 |
|
21 |
|
22 |
|
23 |
-
generate_config = {'do_sample': True, 'top_p': 0.9, 'top_k': 50, 'temperature': 0.
|
24 |
'num_beams': 1, 'max_length': 1024, 'min_length': 3, 'no_repeat_ngram_size': 5,
|
25 |
'length_penalty': 0.6, 'return_dict_in_generate': True, 'output_scores': True}
|
26 |
-
def answer(text, sample=True, top_p=0.9, temperature=0.
|
27 |
'''sample:是否抽样。生成任务,可以设置为True;
|
28 |
top_p:0-1之间,生成的内容越多样'''
|
29 |
text = preprocess(text)
|
|
|
20 |
|
21 |
|
22 |
|
23 |
+
generate_config = {'do_sample': True, 'top_p': 0.9, 'top_k': 50, 'temperature': 0.9,
|
24 |
'num_beams': 1, 'max_length': 1024, 'min_length': 3, 'no_repeat_ngram_size': 5,
|
25 |
'length_penalty': 0.6, 'return_dict_in_generate': True, 'output_scores': True}
|
26 |
+
def answer(text, sample=True, top_p=0.9, temperature=0.9):
|
27 |
'''sample:是否抽样。生成任务,可以设置为True;
|
28 |
top_p:0-1之间,生成的内容越多样'''
|
29 |
text = preprocess(text)
|