xiaoximew commited on
Commit
50e8577
·
1 Parent(s): 63923af
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -53,10 +53,10 @@ def validate_field_word_count(
53
  :return:
54
  """
55
  if len(input_text) == 0:
56
- raise gr.Error(f"{description}不能为空")
57
 
58
  if len(input_text) > max_word_count:
59
- raise gr.Error(f"{description}字数不能超过{max_word_count}")
60
 
61
 
62
  def validate_chat(input_text: str):
@@ -66,7 +66,7 @@ def validate_chat(input_text: str):
66
  :param input_text:
67
  :return:
68
  """
69
- validate_field_word_count(input_text, "输入", 500)
70
 
71
 
72
  def validate_doc_qa(
@@ -158,7 +158,7 @@ with gr.Blocks(
158
  min_width=1368,
159
  height=416,
160
  )
161
- chat_text_input = gr.Textbox(label="输入", min_width=1368)
162
 
163
  with gr.Row():
164
  with gr.Column(scale=2):
 
53
  :return:
54
  """
55
  if len(input_text) == 0:
56
+ raise gr.Error(f"{description} can not be empty")
57
 
58
  if len(input_text) > max_word_count:
59
+ raise gr.Error(f"The number of words in the {description} cannot exceed {max_word_count} words")
60
 
61
 
62
  def validate_chat(input_text: str):
 
66
  :param input_text:
67
  :return:
68
  """
69
+ validate_field_word_count(input_text, "Input", 500)
70
 
71
 
72
  def validate_doc_qa(
 
158
  min_width=1368,
159
  height=416,
160
  )
161
+ chat_text_input = gr.Textbox(label="Input", min_width=1368)
162
 
163
  with gr.Row():
164
  with gr.Column(scale=2):