modify indent
Browse files
app.py
CHANGED
@@ -64,11 +64,11 @@ def summy(text):
|
|
64 |
"""
|
65 |
inputs = tokenizer_sum("summarize: " + text, return_tensors="pt")
|
66 |
outputs = model_sum.generate(
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
)
|
72 |
summarize_text = tokenizer_sum.decode(output[0], skip_special_tokens=True)
|
73 |
|
74 |
return summarize_text
|
|
|
64 |
"""
|
65 |
inputs = tokenizer_sum("summarize: " + text, return_tensors="pt")
|
66 |
outputs = model_sum.generate(
|
67 |
+
inputs["input_ids"],
|
68 |
+
max_new_tokens=300, # 生成数の上限
|
69 |
+
min_length=150, # 生成数の下限
|
70 |
+
num_beams=5 # ビームサーチの設定
|
71 |
+
)
|
72 |
summarize_text = tokenizer_sum.decode(output[0], skip_special_tokens=True)
|
73 |
|
74 |
return summarize_text
|