Add defaulting to english when no argument for language is given

This commit is contained in:
Colin 2023-07-30 22:02:58 -04:00
parent 87be7f961f
commit 659557c974

4
app.py
View File

@ -775,12 +775,16 @@ class LoLLMsWebUI(LoLLMsAPPI):
def list_personalities_categories(self):
language = request.args.get('language')
if language is None:
language = 'english'
personalities_categories_dir = self.lollms_paths.personalities_zoo_path/f'{language}' # replace with the actual path to the models folder
personalities_categories = [f.stem for f in personalities_categories_dir.iterdir() if f.is_dir() and not f.name.startswith(".")]
return jsonify(personalities_categories)
def list_personalities(self):
language = request.args.get('language')
if language is None:
language = 'english'
category = request.args.get('category')
if not category:
return jsonify([])