Spaces:
Sleeping
Sleeping
verify_string_length_short(paragraph)
Browse files
app.py
CHANGED
@@ -1105,7 +1105,7 @@ def verify_string_length(text):
|
|
1105 |
raise gr.Error("輸入的文字長度過長,請重新輸入!")
|
1106 |
|
1107 |
def verify_string_length_short(text):
|
1108 |
-
if len(text) <
|
1109 |
raise gr.Error("輸入的文字長度過短,請重新輸入!")
|
1110 |
|
1111 |
def verify_moderation(text):
|
@@ -1231,6 +1231,7 @@ def get_chinese_paragraph_evaluate_content(thread_id, model, user_content, parag
|
|
1231 |
def get_chinese_paragraph_1st_evaluate_content(thread_id, model, sys_content, paragraph, user_generate_paragraph_evaluate_prompt):
|
1232 |
verify_string_length(paragraph)
|
1233 |
verify_moderation(paragraph)
|
|
|
1234 |
|
1235 |
user_content = f"""
|
1236 |
sys_content: {sys_content}
|
@@ -1246,6 +1247,7 @@ def get_chinese_paragraph_1st_evaluate_content(thread_id, model, sys_content, pa
|
|
1246 |
def get_chinese_paragraph_refine_evaluate_content(thread_id, model, sys_content, paragraph_2, user_refine_paragraph_prompt):
|
1247 |
verify_string_length(paragraph_2)
|
1248 |
verify_moderation(paragraph_2)
|
|
|
1249 |
|
1250 |
user_content = f"""
|
1251 |
sys_content: {sys_content}
|
|
|
1105 |
raise gr.Error("輸入的文字長度過長,請重新輸入!")
|
1106 |
|
1107 |
def verify_string_length_short(text):
|
1108 |
+
if len(text) < 200:
|
1109 |
raise gr.Error("輸入的文字長度過短,請重新輸入!")
|
1110 |
|
1111 |
def verify_moderation(text):
|
|
|
1231 |
def get_chinese_paragraph_1st_evaluate_content(thread_id, model, sys_content, paragraph, user_generate_paragraph_evaluate_prompt):
|
1232 |
verify_string_length(paragraph)
|
1233 |
verify_moderation(paragraph)
|
1234 |
+
verify_string_length_short(paragraph)
|
1235 |
|
1236 |
user_content = f"""
|
1237 |
sys_content: {sys_content}
|
|
|
1247 |
def get_chinese_paragraph_refine_evaluate_content(thread_id, model, sys_content, paragraph_2, user_refine_paragraph_prompt):
|
1248 |
verify_string_length(paragraph_2)
|
1249 |
verify_moderation(paragraph_2)
|
1250 |
+
verify_string_length_short(paragraph_2)
|
1251 |
|
1252 |
user_content = f"""
|
1253 |
sys_content: {sys_content}
|