Skip to content

Conversation

@Icemole
Copy link
Collaborator

@Icemole Icemole commented Jan 13, 2026

The build_batched_fsa function is a nice utility function that can be used if you have your own FSAs already built somehow and you want to join them. However, as the code is currently, we have to build an object of any subclass of _RasrFsaBuilderFbw2. This is cumbersome for the user, who has to provide an extra path in the code that represents the RASR config, and wait for the object to be created (which involves extra overhead, lots of debugging messages in the log, etc). It would be ideal to use the build_batched_fsa function without having to explicitly create any instance.

This PR sets the build_batched_fsa function as static.

I also took the liberty of setting apply_tdp_scale_to_fsa_tuple as static, but this is not too relevant for my use case.

@Icemole
Copy link
Collaborator Author

Icemole commented Jan 13, 2026

Note: the real reason why this change is happening is because we previously had a copy-paste version of build_batched_fsa in our codebase. However, when #89 was merged, the code diverged. Therefore, it made sense to merge both functions into the more stable i6_models implementation as a refactoring step. However, building an object explicitly just to use this function is not desirable because of the reasons I listed above.

@Icemole Icemole self-assigned this Jan 13, 2026
@curufinwe
Copy link
Contributor

If you want an utility function I would just move the function definition out of the class into a standalone function. Keep the interface as is for the classes and call the new utility functions inside of the build_batched_fsa methods.

@Icemole
Copy link
Collaborator Author

Icemole commented Jan 13, 2026

Thanks for the feedback! That also makes sense. I've kept the interface and moved the code into its own function.

@Icemole Icemole changed the title Set TDP scaling and batched FSA build as static Add standalone function to join FSAs for FBW V2 op consumption Jan 13, 2026
@Icemole Icemole merged commit 12faf98 into main Jan 15, 2026
2 checks passed
@Icemole Icemole deleted the fsa-builder-build-batch-static-methods branch January 15, 2026 07:11
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.

4 participants