Nanobit commited on
Commit
903ea30
1 Parent(s): cb7cd34
src/axolotl/prompt_strategies/__init__.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import importlib
2
 
3
 
@@ -7,8 +9,8 @@ def load(strategy, tokenizer, cfg):
7
  if strategy.split(".")[-1].startswith("load_"):
8
  load_fn = strategy.split(".")[-1]
9
  strategy = ".".join(strategy.split(".")[:-1])
10
- m = importlib.import_module(f".{strategy}", "axolotl.prompt_strategies")
11
- fn = getattr(m, load_fn)
12
- return fn(tokenizer, cfg)
13
- except:
14
- pass
 
1
+ """Module to load prompt strategies."""
2
+
3
  import importlib
4
 
5
 
 
9
  if strategy.split(".")[-1].startswith("load_"):
10
  load_fn = strategy.split(".")[-1]
11
  strategy = ".".join(strategy.split(".")[:-1])
12
+ mod = importlib.import_module(f".{strategy}", "axolotl.prompt_strategies")
13
+ func = getattr(mod, load_fn)
14
+ return func(tokenizer, cfg)
15
+ except Exception: # pylint: disable=broad-exception-caught
16
+ return None