Update app.py
Browse files
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
|
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
|