Skip to content

fix: add missing model_type placeholder in _format_file (fixes #142)#153

Open
awanawana wants to merge 1 commit intoMilaNLProc:masterfrom
awanawana:fix/model-dir-format-string
Open

fix: add missing model_type placeholder in _format_file (fixes #142)#153
awanawana wants to merge 1 commit intoMilaNLProc:masterfrom
awanawana:fix/model-dir-format-string

Conversation

@awanawana
Copy link
Copy Markdown

Summary

  • Fixes the format string mismatch in _format_file() method
  • Adds missing mt_{} placeholder for self.model_type

Problem

The format string had 9 placeholders but 10 arguments were passed:

# Before (9 placeholders, 10 args - mismatch!)
model_dir = "..._nc_{}_tpm_{}_tpv_{}_hs_{}_ac_{}_do_{}_lr_{}_mo_{}_rp_{}".format(
    self.n_components,       # 1
    0.0,                     # 2
    1 - (1.0 / self.n_components),  # 3
    self.model_type,         # 4 - NO PLACEHOLDER!
    self.hidden_sizes,       # 5
    ...
)

This causes self.model_type to be silently ignored, meaning different model types (CombinedTM, ZeroShotTM) would save to the same directory.

Solution

Added mt_{} placeholder:

# After (10 placeholders, 10 args - correct!)
model_dir = "..._nc_{}_tpm_{}_tpv_{}_mt_{}_hs_{}_ac_{}_do_{}_lr_{}_mo_{}_rp_{}".format(...)

Related

Fixes #142

🤖 Generated with Claude Code

Fixes MilaNLProc#142

The format string in _format_file() had 9 placeholders but 10 arguments
were passed. The self.model_type argument was included in the format()
call but had no corresponding placeholder in the string.

Added mt_{} placeholder between tpv_{} and hs_{} to include the
model_type in the directory name, which is important for distinguishing
between different model configurations (e.g., CombinedTM vs ZeroShotTM).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Minor bug when constructing the model directory path

1 participant