Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -278,12 +278,12 @@ def rewrite_document(prompt):
|
|
| 278 |
result += f"📝 原文摘要:\n{parsed_text[:300]}...\n\n"
|
| 279 |
result += f"⚠️ 中文改写功能需要更大的模型支持,当前GPT-2主要支持英文。"
|
| 280 |
else:
|
| 281 |
-
input_text = parsed_text[:
|
| 282 |
prompt_text = f"Please rewrite the following text according to this instruction: {prompt}\n\nOriginal text:\n{input_text}\n\nRewritten text:"
|
| 283 |
|
| 284 |
result = generator(
|
| 285 |
prompt_text,
|
| 286 |
-
max_new_tokens=
|
| 287 |
num_return_sequences=1,
|
| 288 |
temperature=0.8,
|
| 289 |
do_sample=True,
|
|
|
|
| 278 |
result += f"📝 原文摘要:\n{parsed_text[:300]}...\n\n"
|
| 279 |
result += f"⚠️ 中文改写功能需要更大的模型支持,当前GPT-2主要支持英文。"
|
| 280 |
else:
|
| 281 |
+
input_text = parsed_text[:2000]
|
| 282 |
prompt_text = f"Please rewrite the following text according to this instruction: {prompt}\n\nOriginal text:\n{input_text}\n\nRewritten text:"
|
| 283 |
|
| 284 |
result = generator(
|
| 285 |
prompt_text,
|
| 286 |
+
max_new_tokens=500,
|
| 287 |
num_return_sequences=1,
|
| 288 |
temperature=0.8,
|
| 289 |
do_sample=True,
|