idkash1 commited on
Commit
c79a37e
·
verified ·
1 Parent(s): d222eff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,7 +67,7 @@ def validate_data(text, model_name, topic):
67
  if model_name not in ['GPT2XL', 'PHI2']:
68
  return f'Model {model_name} not supported'
69
 
70
- if topic not in ['Characters', 'Locations', 'Nature', 'Video games', 'Series', 'Movies', 'War']:
71
  return f'Topic {topic} not supported'
72
 
73
  return ''
@@ -82,4 +82,4 @@ def check_topic(topic):
82
  'wars': 'war'
83
  }
84
 
85
- return topic_dict[topic]
 
67
  if model_name not in ['GPT2XL', 'PHI2']:
68
  return f'Model {model_name} not supported'
69
 
70
+ if check_topic(topic) == None:
71
  return f'Topic {topic} not supported'
72
 
73
  return ''
 
82
  'wars': 'war'
83
  }
84
 
85
+ return topic_dict[topic] if topic in topic_dict else None