Use known paths for Scorer and Alphabet copy in export

This commit is contained in:
Reuben Morais 2021-11-23 14:21:11 +01:00
parent 154a67fb2c
commit 5cefd7069c
1 changed files with 7 additions and 3 deletions

View File

@ -243,9 +243,13 @@ def export_savedmodel():
# Copy scorer and alphabet alongside SavedModel
if Config.scorer_path:
print(f"Saving {Config.scorer_path} to {Config.export_dir}")
shutil.copy(Config.scorer_path, Config.export_dir)
shutil.copy(Config.effective_alphabet_path, Config.export_dir)
shutil.copy(
Config.scorer_path, os.path.join(Config.export_dir, "exported.scorer")
)
shutil.copy(
Config.effective_alphabet_path,
os.path.join(Config.export_dir, "alphabet.txt"),
)
log_info(f"Exported SavedModel to {Config.export_dir}")