Skip to content

Commit e3e4f42

Browse files
committed
Fix compatibility with Hardrules metadata dict
1 parent 5cb7b93 commit e3e4f42

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Bicleaner AI 2.3.2:
8+
### Fixed:
9+
- Fix compatibility with Hardrules metadata dict.
10+
11+
712
## Bicleaner AI 2.3.1:
813
### Added:
914
- `bicleaner-ai-download` quiet mode.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "bicleaner-ai"
3-
version = "2.3.1"
3+
version = "2.3.2"
44
license = {file = "LICENSE"}
55
authors = [
66
{ "name" = "Prompsit Language Engineering", "email" = "[email protected]" }

src/bicleaner_ai/classify.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def load_metadata(args, parser):
7878
try:
7979
# Load YAML
8080
metadata_yaml = yaml.safe_load(metadata_file)
81-
yamlpath = os.path.dirname(os.path.abspath(args.metadata))
82-
metadata_yaml["yamlpath"] = yamlpath
81+
yamldir = os.path.dirname(os.path.abspath(args.metadata))
82+
metadata_yaml["yamldir"] = yamldir
8383

8484
# Read language pair and tokenizers
8585
args.source_lang=metadata_yaml["source_lang"]
@@ -96,7 +96,7 @@ def load_metadata(args, parser):
9696
logging.info(f"Enabling calibrated output with parameters: {cal_params}")
9797
else:
9898
cal_params = None
99-
args.clf = get_model(metadata_yaml["classifier_type"])(yamlpath,
99+
args.clf = get_model(metadata_yaml["classifier_type"])(yamldir,
100100
metadata_yaml["classifier_settings"])
101101
args.clf.load()
102102

@@ -121,7 +121,7 @@ def load_metadata(args, parser):
121121
logging.warning("Porn removal not present in metadata, disabling")
122122
else:
123123
try:
124-
args.porn_removal = fasttext.load_model(os.path.join(yamlpath, metadata_yaml['porn_removal_file']))
124+
args.porn_removal = fasttext.load_model(os.path.join(yamldir, metadata_yaml['porn_removal_file']))
125125
except:
126126
args.porn_removal = fasttext.load_model(args.metadata_yaml['porn_removal_file'])
127127
else:

0 commit comments

Comments
 (0)