Brasd99 commited on
Commit
fa88149
1 Parent(s): 8b35814
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -3
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: AnswerMate
3
- emoji: 🏢
4
  colorFrom: purple
5
  colorTo: yellow
6
  sdk: gradio
 
1
  ---
2
  title: AnswerMate
3
+ emoji: 🧠
4
  colorFrom: purple
5
  colorTo: yellow
6
  sdk: gradio
app.py CHANGED
@@ -59,7 +59,8 @@ def validate_and_get_tags(tags: str) -> List[str]:
59
  if not tags.strip():
60
  raise gr.Error('Validation error. It is necessary to set at least one tag')
61
 
62
- tags = tags.split('\n')
 
63
  if len(tags) > max_tags_count:
64
  raise gr.Error(f'Validation error. The maximum allowed number of tags is {max_tags_count}.')
65
 
@@ -68,8 +69,8 @@ def validate_and_get_tags(tags: str) -> List[str]:
68
  def validate_and_get_questions(questions: str) -> List[str]:
69
  if not questions.strip():
70
  raise gr.Error('Validation error. It is necessary to ask at least one question')
71
-
72
- questions = questions.split('\n')
73
  if len(questions) > max_questions_count:
74
  raise gr.Error(f'Validation error. The maximum allowed number of questions is {max_questions_count}.')
75
 
 
59
  if not tags.strip():
60
  raise gr.Error('Validation error. It is necessary to set at least one tag')
61
 
62
+ tags = [tag.strip() for tag in tags.split('\n') if tag.strip()]
63
+
64
  if len(tags) > max_tags_count:
65
  raise gr.Error(f'Validation error. The maximum allowed number of tags is {max_tags_count}.')
66
 
 
69
  def validate_and_get_questions(questions: str) -> List[str]:
70
  if not questions.strip():
71
  raise gr.Error('Validation error. It is necessary to ask at least one question')
72
+
73
+ questions = [question.strip() for question in questions.split('\n') if question.strip()]
74
  if len(questions) > max_questions_count:
75
  raise gr.Error(f'Validation error. The maximum allowed number of questions is {max_questions_count}.')
76