Skip to content

Commit

Permalink
fix: restore randomize examples setting (#140)
Browse files Browse the repository at this point in the history
* fix: restore randomize examples setting

* fix: restore randomize examples setting
  • Loading branch information
JarbasAl authored Nov 17, 2024
1 parent 4662384 commit 741250a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import datetime
import random
from typing import Dict, List, Tuple

from ovos_bus_client import Message
Expand Down Expand Up @@ -215,6 +216,8 @@ def update_examples(self):
examples += data.get(self.lang, [])
examples = [e for e in examples if e.strip()] # ensure no empty strings
if examples:
if self.settings.get("randomize_examples", True):
random.shuffle(examples)
self.gui['skill_examples'] = {"examples": examples}
self.gui['skill_info_enabled'] = self.examples_enabled
else:
Expand Down

0 comments on commit 741250a

Please sign in to comment.